Commit ec567710 authored by Jason Madden's avatar Jason Madden

Always use 0 when getting the address for getaddrinfo

This matches what all versions of Python do and reverts
https://github.com/gevent/gevent/commit/9b1bccffc11455112076189f35023291cf97a2a2

The bug that commit references was marked as "won't fix". This is part
of an effort to adapt to changes in 3.7b2 that lead us to produce a
different errno than the system does for
`socket.create_connection(('localhost', ...))`
parent 5200367c
......@@ -75,7 +75,7 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
host, port = address
# getaddrinfo is documented as returning a list, but our interface
# is pluggable, so be sure it does.
addrs = list(getaddrinfo(host, port, 0 if has_ipv6 else AF_INET, SOCK_STREAM))
addrs = list(getaddrinfo(host, port, 0, SOCK_STREAM))
if not addrs:
raise error("getaddrinfo returns an empty list")
......
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