Commit 850630b4 authored by Claude Paroz's avatar Claude Paroz
Browse files

Replaced deprecated sslerror by ssl.SSLError

The exact conditions on which this exception is raised are not
known, but this replacement is the best guess we can do at this
point.
parent 6248833d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
"""SMTP email backend class."""
import smtplib
import socket
import ssl
import threading

from django.conf import settings
@@ -65,7 +65,7 @@ class EmailBackend(BaseEmailBackend):
        try:
            try:
                self.connection.quit()
            except (socket.sslerror, smtplib.SMTPServerDisconnected):
            except (ssl.SSLError, smtplib.SMTPServerDisconnected):
                # This happens when calling quit() on a TLS connection
                # sometimes, or when the connection was already disconnected
                # by the server.