From: Yury Selivanov Date: Thu, 3 Nov 2016 22:35:23 +0000 (-0700) Subject: asyncio: Sync with upstream X-Git-Tag: v3.6.0b4~157^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5420492cf367a4224174c5595a4c8a2d059136c;p=python asyncio: Sync with upstream --- 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: