summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/base_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r--Lib/asyncio/base_events.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 2f7f197..42d8b0b 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -247,7 +247,11 @@ class BaseEventLoop(events.AbstractEventLoop):
This clears the queues and shuts down the executor,
but does not wait for the executor to finish.
+
+ The event loop must not be running.
"""
+ if self._running:
+ raise RuntimeError("cannot close a running event loop")
if self._closed:
return
self._closed = True