aboutsummaryrefslogtreecommitdiff
path: root/urllib3/util/connection.py
diff options
context:
space:
mode:
Diffstat (limited to 'urllib3/util/connection.py')
-rw-r--r--urllib3/util/connection.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/urllib3/util/connection.py b/urllib3/util/connection.py
index 859aec6..9ed5a64 100644
--- a/urllib3/util/connection.py
+++ b/urllib3/util/connection.py
@@ -60,6 +60,8 @@ def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
"""
host, port = address
+ if host.startswith('['):
+ host = host.strip('[]')
err = None
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res