summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_channel_lsp.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_channel_lsp.py')
-rw-r--r--src/testdir/test_channel_lsp.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/testdir/test_channel_lsp.py b/src/testdir/test_channel_lsp.py
index 2357452d7e..10b4fb43f3 100644
--- a/src/testdir/test_channel_lsp.py
+++ b/src/testdir/test_channel_lsp.py
@@ -306,7 +306,12 @@ def main(host, port, server_class=ThreadedTCPServer):
writePortInFile(port)
time.sleep(0.5)
- server = server_class((host, port), ThreadedTCPRequestHandler)
+ addrs = socket.getaddrinfo(host, port, 0, 0, socket.IPPROTO_TCP)
+ # Each addr is a (family, type, proto, canonname, sockaddr) tuple
+ sockaddr = addrs[0][4]
+ server_class.address_family = addrs[0][0]
+
+ server = server_class(sockaddr[0:2], ThreadedTCPRequestHandler)
ip, port = server.server_address[0:2]
# Start a thread with the server. That thread will then start a new thread