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

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


http://hg.python.org/cpython/rev/1a2ead9faa3f
changeset:   80910:1a2ead9faa3f
branch:      3.2
parent:      80905:b7419f88c628
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Mon Dec 17 18:54:53 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
@@ -892,13 +892,13 @@
         try:
             self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
             self.sock.connect(host)
-        except socket.error as msg:
+        except socket.error:
             if self.debuglevel > 0:
                 print('connect fail:', host, file=stderr)
             if self.sock:
                 self.sock.close()
             self.sock = None
-            raise socket.error(msg)
+            raise
         (code, msg) = self.getreply()
         if self.debuglevel > 0:
             print('connect:', msg, file=stderr)

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


More information about the Python-checkins mailing list