mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
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
This commit is contained in:
parent
8dbe08eb7c
commit
5d09d11aa0
4 changed files with 30 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue