summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-13 04:08:53 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-13 04:08:53 (GMT)
commit62bc8aadd4465da30e09c1003cc4bfea014670da (patch)
tree2ad655a2a0154cdb1db048f42723100b02a62758
parent7ca6677218e7e31fa6a6629c4fe6d052de22793c (diff)
downloadcpython-62bc8aadd4465da30e09c1003cc4bfea014670da.zip
cpython-62bc8aadd4465da30e09c1003cc4bfea014670da.tar.gz
cpython-62bc8aadd4465da30e09c1003cc4bfea014670da.tar.bz2
Don't fail if another process is listening on our port.
-rw-r--r--Lib/test/test_asynchat.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py
index f93587a..9926167 100644
--- a/Lib/test/test_asynchat.py
+++ b/Lib/test/test_asynchat.py
@@ -13,7 +13,8 @@ class echo_server(threading.Thread):
def run(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- sock.bind((HOST, PORT))
+ global PORT
+ PORT = test_support.bind_port(sock, HOST, PORT)
sock.listen(1)
conn, client = sock.accept()
buffer = ""