mirror of
https://github.com/python/cpython.git
synced 2026-02-05 09:25:35 +00:00
Patch #1100140: improved smtp connect debugging
Don't print the same (host, port) tuple thrice when debugging, but first print (host, port), then (ip, port) and then the error message.
This commit is contained in:
parent
fe33d0ba87
commit
5954623bc0
1 changed files with 2 additions and 2 deletions
|
|
@ -290,10 +290,10 @@ def connect(self, host='localhost', port = 0):
|
|||
af, socktype, proto, canonname, sa = res
|
||||
try:
|
||||
self.sock = socket.socket(af, socktype, proto)
|
||||
if self.debuglevel > 0: print>>stderr, 'connect:', (host, port)
|
||||
if self.debuglevel > 0: print>>stderr, 'connect:', sa
|
||||
self.sock.connect(sa)
|
||||
except socket.error, msg:
|
||||
if self.debuglevel > 0: print>>stderr, 'connect fail:', (host, port)
|
||||
if self.debuglevel > 0: print>>stderr, 'connect fail:', msg
|
||||
if self.sock:
|
||||
self.sock.close()
|
||||
self.sock = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue