There was an error while loading. Please reload this page.
1 parent 491a912 commit c542049Copy full SHA for c542049
1 file changed
Lib/asyncio/base_events.py
@@ -348,6 +348,9 @@ def _asyncgen_finalizer_hook(self, agen):
348
self._asyncgens.discard(agen)
349
if not self.is_closed():
350
self.create_task(agen.aclose())
351
+ # Wake up the loop if the finalizer was called from
352
+ # a different thread.
353
+ self._write_to_self()
354
355
def _asyncgen_firstiter_hook(self, agen):
356
if self._asyncgens_shutdown_called:
0 commit comments