summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-03 22:35:23 (GMT)
committerYury Selivanov <yury@magic.io>2016-11-03 22:35:23 (GMT)
commitc5420492cf367a4224174c5595a4c8a2d059136c (patch)
treec2c7153fea3069fcb381e42f1bf1295f83f7e293 /Lib/asyncio
parent491a912659a4aeb57c400f37b8059fa1ef7bed73 (diff)
downloadcpython-c5420492cf367a4224174c5595a4c8a2d059136c.zip
cpython-c5420492cf367a4224174c5595a4c8a2d059136c.tar.gz
cpython-c5420492cf367a4224174c5595a4c8a2d059136c.tar.bz2
asyncio: Sync with upstream
Diffstat (limited to 'Lib/asyncio')
-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 ddf041d..5597bcb 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: