summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/proactor_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/proactor_events.py')
-rw-r--r--Lib/asyncio/proactor_events.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
index a1e2fef..4c527aa 100644
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -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