summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-02-22 16:06:02 (GMT)
committerGuido van Rossum <guido@python.org>1994-02-22 16:06:02 (GMT)
commit76ca3c17f0922c17b6da43f7345b4f26cff854bc (patch)
tree355c6c057cdaa0ad3bb4ddc682191e9659e4729d /Lib/httplib.py
parent9f14863053676292d9ea1a3d0ae792c9c568fd1e (diff)
downloadcpython-76ca3c17f0922c17b6da43f7345b4f26cff854bc.zip
cpython-76ca3c17f0922c17b6da43f7345b4f26cff854bc.tar.gz
cpython-76ca3c17f0922c17b6da43f7345b4f26cff854bc.tar.bz2
Fix bug with somtimes uninitialized port
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index ea6e565..d494e21 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)