Commit 9b1bccff authored by Ralf Schmitt's avatar Ralf Schmitt

do not lookup IPv6 addresses in create_connection if IPv6 is unsupported

see http://bugs.python.org/issue7735
parent ebf4a1d6
......@@ -590,7 +590,7 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
host, port = address
err = None
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
for res in getaddrinfo(host, port, 0 if has_ipv6 else AF_INET, SOCK_STREAM):
af, socktype, proto, _canonname, sa = res
sock = None
try:
......
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