]> granicus.if.org Git - python/commitdiff
SF bug #1046855: httplib index out of range
authorRaymond Hettinger <python@rcn.com>
Thu, 14 Oct 2004 15:23:38 +0000 (15:23 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 14 Oct 2004 15:23:38 +0000 (15:23 +0000)
Lib/httplib.py

index d4fcf7c2d52a583bb253cacb4a2479b9b55cf45e..72e8a72539885b619e254b439fe7a1b0c9e4511f 100644 (file)
@@ -593,7 +593,7 @@ class HTTPConnection:
                 host = host[:i]
             else:
                 port = self.default_port
-            if host[0] == '[' and host[-1] == ']':
+            if host and host[0] == '[' and host[-1] == ']':
                 host = host[1:-1]
         self.host = host
         self.port = port