summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-01-03 20:41:45 +0100
committerClaude Paroz <claude@2xlibre.net>2013-01-03 20:41:45 +0100
commitffa50ca35219aa328e8e4ecda450a53c27c2e710 (patch)
treef6233843b313a9616a1611fb4e11443a41d8134a /django
parent1b3f832ab7291b6d92a27288bb97b3a3b712ebcb (diff)
Fixed #19382 -- Stopped smtp backend raising exception when already closed
Thanks Sebastian Noack for the report and the initial patch.
Diffstat (limited to 'django')
-rw-r--r--django/core/mail/backends/smtp.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/core/mail/backends/smtp.py b/django/core/mail/backends/smtp.py
index baffa8f2df..3ae08f4340 100644
--- a/django/core/mail/backends/smtp.py
+++ b/django/core/mail/backends/smtp.py
@@ -60,6 +60,8 @@ class EmailBackend(BaseEmailBackend):
def close(self):
"""Closes the connection to the email server."""
+ if self.connection is None:
+ return
try:
try:
self.connection.quit()