Commit ed3f6c6c authored by Andrew Svetlov's avatar Andrew Svetlov

Issue #16647: save socket error details in LMTP.connect()

Patch by Serhiy Storchaka.
parent 78efadb8
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment