diff options
author | Kumar Aditya <kumaraditya@python.org> | 2025-03-18 16:20:47 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-18 16:20:47 +0530 |
commit | ab6333f7f56554bfd6c01eff567ddfb163a3dae6 (patch) | |
tree | a059f451c0917a2023a1eda10dd965b214f57581 /Lib/test/test_asyncio/functional.py | |
parent | 812074e291d559824d496909a87fb5c26c37f60c (diff) | |
download | cpython-ab6333f7f56554bfd6c01eff567ddfb163a3dae6.tar.gz cpython-ab6333f7f56554bfd6c01eff567ddfb163a3dae6.zip |
gh-128002: fix tsan race in closing socket in `test_sslproto` (#131399)
Diffstat (limited to 'Lib/test/test_asyncio/functional.py')
-rw-r--r-- | Lib/test/test_asyncio/functional.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/test/test_asyncio/functional.py b/Lib/test/test_asyncio/functional.py index 2934325b6df..555394b915d 100644 --- a/Lib/test/test_asyncio/functional.py +++ b/Lib/test/test_asyncio/functional.py @@ -217,16 +217,15 @@ class TestThreadedServer(SocketThread): pass finally: super().stop() - - def run(self): - try: - with self._sock: - self._sock.setblocking(False) - self._run() - finally: + self._sock.close() self._s1.close() self._s2.close() + + def run(self): + self._sock.setblocking(False) + self._run() + def _run(self): while self._active: if self._clients >= self._max_clients: |