]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1100140: improved smtp connect debugging
authorJohannes Gijsbers <jlg@dds.nl>
Sun, 16 Jan 2005 13:04:30 +0000 (13:04 +0000)
committerJohannes Gijsbers <jlg@dds.nl>
Sun, 16 Jan 2005 13:04:30 +0000 (13:04 +0000)
Don't print the same (host, port) tuple thrice when debugging, but first print
(host, port), then (ip, port) and then the error message.

Lib/smtplib.py

index 61c35772090be3b8013953b32f2c8521e414b5f9..52a2e1f86688ad529291f8d21395f48e6fa2b72b 100755 (executable)
@@ -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