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.
This commit is contained in:
parent
6248833d9e
commit
850630b4b7
|
@ -1,6 +1,6 @@
|
||||||
"""SMTP email backend class."""
|
"""SMTP email backend class."""
|
||||||
import smtplib
|
import smtplib
|
||||||
import socket
|
import ssl
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -65,7 +65,7 @@ class EmailBackend(BaseEmailBackend):
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
self.connection.quit()
|
self.connection.quit()
|
||||||
except (socket.sslerror, smtplib.SMTPServerDisconnected):
|
except (ssl.SSLError, smtplib.SMTPServerDisconnected):
|
||||||
# This happens when calling quit() on a TLS connection
|
# This happens when calling quit() on a TLS connection
|
||||||
# sometimes, or when the connection was already disconnected
|
# sometimes, or when the connection was already disconnected
|
||||||
# by the server.
|
# by the server.
|
||||||
|
|
Loading…
Reference in New Issue