diff options
| author | Claude Paroz <claude@2xlibre.net> | 2013-01-03 22:12:11 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-01-03 22:16:43 +0100 |
| commit | 850630b4b7e79b76ad9732db1be6a2aa4257893f (patch) | |
| tree | 8164d911f201fb7ec9b423f103e5f3df93d9c1c8 | |
| parent | 6248833d9e35926d6ccd4b4d602f7ea89fea0c74 (diff) | |
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.
| -rw-r--r-- | django/core/mail/backends/smtp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/mail/backends/smtp.py b/django/core/mail/backends/smtp.py index 3ae08f4340..e456b7864e 100644 --- a/django/core/mail/backends/smtp.py +++ b/django/core/mail/backends/smtp.py @@ -1,6 +1,6 @@ """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. |
