diff options
author | Guido van Rossum <guido@python.org> | 2022-11-24 15:32:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-24 15:32:58 (GMT) |
commit | 5d09d11aa0b89aeba187f4f520728ccaf4fc5ac1 (patch) | |
tree | f650a356b90872045f7548b4f20928c79fbfe968 /Lib/asyncio/base_events.py | |
parent | 8dbe08eb7c807f484fe9870f5b7f5ae2881fd966 (diff) | |
download | cpython-5d09d11aa0b89aeba187f4f520728ccaf4fc5ac1.zip cpython-5d09d11aa0b89aeba187f4f520728ccaf4fc5ac1.tar.gz cpython-5d09d11aa0b89aeba187f4f520728ccaf4fc5ac1.tar.bz2 |
GH-79033: Fix asyncio.Server.wait_closed() (#98582)
It was a no-op when used as recommended (after close()).
I had to debug one test (test__sock_sendfile_native_failure) --
the cleanup sequence for the test fixture was botched.
Hopefully that's not a portend of problems in user code --
this has never worked so people may well be doing this wrong. :-(
Co-authored-by: kumar aditya
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r-- | Lib/asyncio/base_events.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 91d32e3..f2f9375 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -377,7 +377,7 @@ class Server(events.AbstractServer): self._serving_forever_fut = None async def wait_closed(self): - if self._sockets is None or self._waiters is None: + if self._waiters is None or self._active_count == 0: return waiter = self._loop.create_future() self._waiters.append(waiter) |