From: Neil Chintomby Date: Thu, 29 Oct 2015 23:33:30 +0000 (-0700) Subject: Use `127.0.0.1` when binding test server socket. X-Git-Tag: v4.4.0b1~74^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=147861f2687b46647fae6a2b7f584930154adafb;p=thirdparty%2Ftornado.git Use `127.0.0.1` when binding test server socket. --- diff --git a/tornado/testing.py b/tornado/testing.py index 54d76fe40..119234d04 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -97,8 +97,8 @@ def bind_unused_port(reuse_port=False): Returns a tuple (socket, port). """ - [sock] = netutil.bind_sockets(None, 'localhost', family=socket.AF_INET, - reuse_port=reuse_port) + sock = netutil.bind_sockets(None, '127.0.0.1', family=socket.AF_INET, + reuse_port=reuse_port)[0] port = sock.getsockname()[1] return sock, port