From: Guido van Rossum Date: Tue, 22 Feb 1994 16:06:02 +0000 (+0000) Subject: Fix bug with somtimes uninitialized port X-Git-Tag: v1.0.2~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76ca3c17f0922c17b6da43f7345b4f26cff854bc;p=thirdparty%2FPython%2Fcpython.git Fix bug with somtimes uninitialized port --- diff --git a/Lib/httplib.py b/Lib/httplib.py index ea6e565fbe21..d494e21ef04c 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -56,10 +56,11 @@ class HTTP: port = args[0] else: i = string.find(host, ':') + port = None if i >= 0: host, port = host[:i], host[i+1:] try: port = string.atoi(port) - except string.atoi_error: port = None + except string.atoi_error: pass if not port: port = HTTP_PORT self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if self.debuglevel > 0: print 'connect:', (host, port)