From 5bb61195fdad5c52937725e834e3cd0e9eacb5fa Mon Sep 17 00:00:00 2001 From: jordan Date: Mon, 26 Sep 2011 20:53:28 +0000 Subject: [PATCH] just pass AttributeError exceptions because their is a chance that a None object has already been assigned to the connection instance and log all other email errors git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1178 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/utils/mail.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/forum/utils/mail.py b/forum/utils/mail.py index 8016b00..84a79b3 100644 --- a/forum/utils/mail.py +++ b/forum/utils/mail.py @@ -94,12 +94,15 @@ def create_and_send_mail_messages(messages): logging.error("Couldn't send mail using the sendmail method: %s" % e) try: connection.quit() - connection = None - except Exception: + except Exception, e: + logging.error(e) + finally: connection = None try: connection.quit() + except AttributeError: + pass except socket.sslerror: connection.close() except Exception, e: -- 2.39.5