summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-01-03 22:12:11 +0100
committerClaude Paroz <claude@2xlibre.net>2013-01-03 22:17:30 +0100
commitb641357a37528c39de0c181ad495cbd39f3bf530 (patch)
tree5677fe274d2c79550422a6eaaa0d71957f86ab11 /django
parent5b8c0d22cc07ca727c032edf3309fab9cb39f21d (diff)
[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 point. Backport of 850630b4b7 from master.
Diffstat (limited to 'django')
-rw-r--r--django/core/mail/backends/smtp.py4
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.