]> granicus.if.org Git - python/commitdiff
asyncio: Sync with upstream
authorYury Selivanov <yury@magic.io>
Thu, 3 Nov 2016 22:35:23 +0000 (15:35 -0700)
committerYury Selivanov <yury@magic.io>
Thu, 3 Nov 2016 22:35:23 +0000 (15:35 -0700)
Lib/asyncio/base_events.py

index ddf041d4d06d11ac427bb8f7ba9c2d714ff59e3c..5597bcb7cdb0e9dfdfec8a1a21d6399d536eb31d 100644 (file)
@@ -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: