bpo-35934: Add socket.create_server() utility function (GH-11784)

This commit is contained in:
Giampaolo Rodola 2019-04-09 00:34:02 +02:00 committed by GitHub
parent 58721a9030
commit eb7e29f2a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 289 additions and 88 deletions

View file

@ -3334,9 +3334,7 @@ class _TestPicklingConnections(BaseTestCase):
new_conn.close()
l.close()
l = socket.socket()
l.bind((test.support.HOST, 0))
l.listen()
l = socket.create_server((test.support.HOST, 0))
conn.send(l.getsockname())
new_conn, addr = l.accept()
conn.send(new_conn)
@ -4345,9 +4343,7 @@ class TestWait(unittest.TestCase):
def test_wait_socket(self, slow=False):
from multiprocessing.connection import wait
l = socket.socket()
l.bind((test.support.HOST, 0))
l.listen()
l = socket.create_server((test.support.HOST, 0))
addr = l.getsockname()
readers = []
procs = []