Kaydet (Commit) 4ca73559 authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Issue #19299: fix refleak test failures in test_asyncio

üst 34d33a59
......@@ -185,6 +185,14 @@ class BaseEventLoop(events.AbstractEventLoop):
"""
self.call_soon(_raise_stop_error)
def close(self):
self._ready.clear()
self._scheduled.clear()
executor = self._default_executor
if executor is not None:
self._default_executor = None
executor.shutdown(wait=False)
def is_running(self):
"""Returns running status of event loop."""
return self._running
......
......@@ -276,6 +276,7 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
self._proactor.close()
self._proactor = None
self._selector = None
super().close()
def sock_recv(self, sock, n):
return self._proactor.recv(sock, n)
......
......@@ -56,6 +56,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
self._close_self_pipe()
self._selector.close()
self._selector = None
super().close()
def _socketpair(self):
raise NotImplementedError
......
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