Skip to content

Commit dcbb1f4

Browse files
committed
Fix async generators finalization to work correctly in debug mode
Closes #200.
1 parent 75e7c32 commit dcbb1f4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

uvloop/loop.pyx

+1-4
Original file line numberDiff line numberDiff line change
@@ -2913,10 +2913,7 @@ cdef class Loop:
29132913
def _asyncgen_finalizer_hook(self, agen):
29142914
self._asyncgens.discard(agen)
29152915
if not self.is_closed():
2916-
self.create_task(agen.aclose())
2917-
# Wake up the loop if the finalizer was called from
2918-
# a different thread.
2919-
self.handler_async.send()
2916+
self.call_soon_threadsafe(self.create_task, agen.aclose())
29202917

29212918
def _asyncgen_firstiter_hook(self, agen):
29222919
if self._asyncgens_shutdown_called:

0 commit comments

Comments
 (0)