From 147861f2687b46647fae6a2b7f584930154adafb Mon Sep 17 00:00:00 2001 From: Neil Chintomby Date: Thu, 29 Oct 2015 16:33:30 -0700 Subject: [PATCH] Use `127.0.0.1` when binding test server socket. --- tornado/testing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.47.2