Browse files

[1.5.x] 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
Backport of 850630b from master.
  • Loading branch information...
claudep committed Jan 3, 2013
1 parent 5b8c0d2 commit b641357a37528c39de0c181ad495cbd39f3bf530
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/core/mail/backends/
@@ -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 @@ def close(self):
- 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.

0 comments on commit b641357

Please sign in to comment.