Ticket #19382: 0001-Don-t-fail-when-closing-closed-smtp-backend.patch

File 0001-Don-t-fail-when-closing-closed-smtp-backend.patch, 779 bytes (added by Sebastian Noack, 12 years ago)
  • django/core/mail/backends/smtp.py

    From e07389caaf6ea07e158479a5a797590314792916 Mon Sep 17 00:00:00 2001
    From: Sebastian Noack <sebastian.noack@gmail.com>
    Date: Wed, 28 Nov 2012 21:25:19 +0100
    Subject: [PATCH] Don't fail when closing closed smtp backend.
    
    ---
     django/core/mail/backends/smtp.py |    2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/django/core/mail/backends/smtp.py b/django/core/mail/backends/smtp.py
    index 5d4bfa5..c23bdd2 100644
    a b class EmailBackend(BaseEmailBackend):  
    5959
    6060    def close(self):
    6161        """Closes the connection to the email server."""
     62        if self.connection is None:
     63            return
    6264        try:
    6365            try:
    6466                self.connection.quit()
Back to Top