Update tornado/netutil.py

`socket.getadrrinfo` yields some strange output if Python is compiled with `--disable-ipv6`, resulting in a `bad family` error.
See http://bugs.python.org/issue16208
This commit is contained in:
Marc Schlaich 2013-01-22 09:33:03 +01:00
parent 443c7f34b8
commit 48e81baee2
1 changed files with 2 additions and 0 deletions

View File

@ -53,6 +53,8 @@ def bind_sockets(port, address=None, family=socket.AF_UNSPEC, backlog=128, flags
sockets = []
if address == "":
address = None
if not socket.has_ipv6:
family = socket.AF_INET
if flags is None:
flags = socket.AI_PASSIVE
for res in set(socket.getaddrinfo(address, port, family, socket.SOCK_STREAM,