[Python-checkins] cpython (2.7): Issue #16647: save socket error details in LMTP.connect()

andrew.svetlov python-checkins at python.org
Mon Dec 17 18:08:15 CET 2012


http://hg.python.org/cpython/rev/98b73c0103d9
changeset:   80913:98b73c0103d9
branch:      2.7
parent:      80901:542cfc75c043
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Mon Dec 17 19:06:43 2012 +0200
summary:
  Issue #16647: save socket error details in LMTP.connect()

Patch by Serhiy Storchaka.

files:
  Lib/smtplib.py |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Lib/smtplib.py b/Lib/smtplib.py
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -818,13 +818,13 @@
         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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list