From: Andrew Svetlov Date: Mon, 17 Dec 2012 17:06:43 +0000 (+0200) Subject: Issue #16647: save socket error details in LMTP.connect() X-Git-Tag: v2.7.5~109^2~42^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed3f6c6c79314df3d88ff3523c89f431d5666838;p=python Issue #16647: save socket error details in LMTP.connect() Patch by Serhiy Storchaka. --- diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 07582f673b..099e54a4fa 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -818,13 +818,13 @@ class LMTP(SMTP): try: self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sock.connect(host) - except socket.error, msg: + except socket.error: if self.debuglevel > 0: print>>stderr, 'connect fail:', host if self.sock: self.sock.close() self.sock = None - raise socket.error, msg + raise (code, msg) = self.getreply() if self.debuglevel > 0: print>>stderr, "connect:", msg