summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/server.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py
index ca2dd50..22d865f 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -1226,6 +1226,9 @@ def test(HandlerClass=BaseHTTPRequestHandler,
"""
server_address = (bind, port)
+ if ':' in bind:
+ ServerClass.address_family = socket.AF_INET6
+
HandlerClass.protocol_version = protocol
with ServerClass(server_address, HandlerClass) as httpd:
sa = httpd.socket.getsockname()