From 48e81baee2106059dd67906c87c6ea4500c380c9 Mon Sep 17 00:00:00 2001 From: Marc Schlaich Date: Tue, 22 Jan 2013 09:33:03 +0100 Subject: [PATCH] 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 --- tornado/netutil.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tornado/netutil.py b/tornado/netutil.py index a3e95686..0d711d4d 100644 --- a/tornado/netutil.py +++ b/tornado/netutil.py @@ -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,