Commit 4c85ec99 authored by Victor Stinner's avatar Victor Stinner

Issue #22922: Fix ProactorEventLoop.close()

Call _stop_accept_futures() before sestting the _closed attribute, otherwise
call_soon() raises an error.
parent e80bf0d4
......@@ -387,11 +387,13 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
sock, protocol, waiter, extra)
def close(self):
if self._running:
raise RuntimeError("Cannot close a running event loop")
if self.is_closed():
return
super().close()
self._stop_accept_futures()
self._close_self_pipe()
super().close()
self._proactor.close()
self._proactor = None
self._selector = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment