]> granicus.if.org Git - python/commitdiff
Issue #16647: save socket error details in LMTP.connect()
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Mon, 17 Dec 2012 17:06:43 +0000 (19:06 +0200)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Mon, 17 Dec 2012 17:06:43 +0000 (19:06 +0200)
Patch by Serhiy Storchaka.

Lib/smtplib.py

index 07582f673bc0880375106d517d1e906b49ad3739..099e54a4fa1e3ccbd43a235a502e4fef7f5b2683 100755 (executable)
@@ -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