From dceb544fb51b11fe6f97365cc036e9f3775cb00f Mon Sep 17 00:00:00 2001 From: Mauricio Souza Lima Date: Tue, 7 May 2013 18:00:23 -0300 Subject: [PATCH] change bind_unused_port to pass None as port bind_unused_port was passing 0 as port number to the socket module. This generated some exceptional behaviour on systems where nslookup of localhost didn't returned the loopback interface. --- tornado/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/testing.py b/tornado/testing.py index 00364f124..f537d90d2 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -77,7 +77,7 @@ def bind_unused_port(): Returns a tuple (socket, port). """ - [sock] = netutil.bind_sockets(0, 'localhost', family=socket.AF_INET) + [sock] = netutil.bind_sockets(None, 'localhost', family=socket.AF_INET) port = sock.getsockname()[1] return sock, port -- 2.47.2