From: Johannes Gijsbers Date: Sun, 16 Jan 2005 13:04:30 +0000 (+0000) Subject: Patch #1100140: improved smtp connect debugging X-Git-Tag: v2.5a0~2106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5954623bc052ab17799a6b3ffcaaec8d99d977f5;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 61c35772090b..52a2e1f86688 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -290,10 +290,10 @@ class SMTP: 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