From 76ca3c17f0922c17b6da43f7345b4f26cff854bc Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 22 Feb 1994 16:06:02 +0000 Subject: [PATCH] Fix bug with somtimes uninitialized port --- Lib/httplib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/httplib.py b/Lib/httplib.py index ea6e565fbe2..d494e21ef04 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)