summaryrefslogtreecommitdiff
path: root/Lib/asyncio/base_events.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-03 15:35:23 -0700
committerYury Selivanov <yury@magic.io>2016-11-03 15:35:23 -0700
commitbd2f8fd9473e381e9d800cdd4a81a4c3c4b53c70 (patch)
treecae00492d600b97b4f8502f25562a78836982c51 /Lib/asyncio/base_events.py
parent0e836046d564743e4409fb48f0054a5f73be8c84 (diff)
downloadcpython-bd2f8fd9473e381e9d800cdd4a81a4c3c4b53c70.tar.gz
asyncio: Sync with upstream
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r--Lib/asyncio/base_events.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index ddf041d4d0..5597bcb7cd 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -348,6 +348,9 @@ class BaseEventLoop(events.AbstractEventLoop):
self._asyncgens.discard(agen)
if not self.is_closed():
self.create_task(agen.aclose())
+ # Wake up the loop if the finalizer was called from
+ # a different thread.
+ self._write_to_self()
def _asyncgen_firstiter_hook(self, agen):
if self._asyncgens_shutdown_called: