summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7a8cd2d)
Python on Windows doesn't define socket.AI_ADDRCONFIG. This is likely
because the flag is only supported by getaddrinfo() on Vista or later.
if self._sock:
raise ConnectionError("Already connected")
msg = "getaddrinfo returns an empty list"
if self._sock:
raise ConnectionError("Already connected")
msg = "getaddrinfo returns an empty list"
+ try:
+ flags = socket.AI_ADDRCONFIG
+ except AttributeError:
+ flags = 0
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
socket.SOCK_STREAM, socket.IPPROTO_TCP,
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
socket.SOCK_STREAM, socket.IPPROTO_TCP,
af, socktype, proto, canonname, sa = res
try:
self._sock = socket.socket(af, socktype, proto)
af, socktype, proto, canonname, sa = res
try:
self._sock = socket.socket(af, socktype, proto)