Commit 953094e5 authored by Guido van Rossum's avatar Guido van Rossum

Fix bug with somtimes uninitialized port

parent 04836c22
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment