]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Update tornado/netutil.py 670/head
authorMarc Schlaich <marc.schlaich@googlemail.com>
Tue, 22 Jan 2013 08:33:03 +0000 (09:33 +0100)
committerMarc Schlaich <marc.schlaich@googlemail.com>
Tue, 22 Jan 2013 08:33:03 +0000 (09:33 +0100)
`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

index a3e9568686969248768d7e0f204c18feaf988859..0d711d4d9c2ddd4858f7dd00576887241b19c43e 100644 (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,