summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index d4fcf7c..72e8a72 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -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