Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c542049

Browse files
committed
asyncio: Sync with upstream
1 parent 491a912 commit c542049

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/asyncio/base_events.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ def _asyncgen_finalizer_hook(self, agen):
348348
self._asyncgens.discard(agen)
349349
if not self.is_closed():
350350
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()
351354

352355
def _asyncgen_firstiter_hook(self, agen):
353356
if self._asyncgens_shutdown_called:

0 commit comments

Comments
 (0)