mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #16647: save socket error details in LMTP.connect()
Patch by Serhiy Storchaka.
This commit is contained in:
parent
78efadb86f
commit
ed3f6c6c79
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue