From 212b51c920a12ac6c08bea1d2fbabcdf05f8c89c Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Mon, 23 Dec 2024 12:38:49 -0800 Subject: [PATCH] Clean up test --- Tests/modules/network_related/test__socket.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/modules/network_related/test__socket.py b/Tests/modules/network_related/test__socket.py index 3c45bffdb..594eabb58 100644 --- a/Tests/modules/network_related/test__socket.py +++ b/Tests/modules/network_related/test__socket.py @@ -533,14 +533,14 @@ def test_misc(self): def test_makefile_refcount(self): "Ensures that the _socket stays open while there's still a file associated" - GPORT = None + PORT = None def echoer(): - nonlocal GPORT + nonlocal PORT s = socket.socket() s.settimeout(15) # prevents the server from staying open if the client never connects s.bind(('localhost', 0)) s.listen(5) - GPORT = s.getsockname()[1] + PORT = s.getsockname()[1] (s2, _) = s.accept() s2.send(s2.recv(10)) s2.close() @@ -549,7 +549,7 @@ def echoer(): _thread.start_new_thread(echoer, ()) for _ in range(20): time.sleep(0.5) - if GPORT is not None: + if PORT is not None: break if is_mono: @@ -558,7 +558,7 @@ def echoer(): s = socket.socket() if is_mono: dummy.close() - s.connect(('localhost', GPORT)) + s.connect(('localhost', PORT)) f1 = s.makefile('r') f2 = s.makefile('w') s.close()