Skip to content

Commit

Permalink
Fix async generators finalization to work correctly in debug mode
Browse files Browse the repository at this point in the history
Closes #200.
  • Loading branch information
1st1 committed Oct 30, 2018
1 parent 75e7c32 commit dcbb1f4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions uvloop/loop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2913,10 +2913,7 @@ cdef class Loop:
def _asyncgen_finalizer_hook(self, agen):
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.handler_async.send()
self.call_soon_threadsafe(self.create_task, agen.aclose())

def _asyncgen_firstiter_hook(self, agen):
if self._asyncgens_shutdown_called:
Expand Down

0 comments on commit dcbb1f4

Please sign in to comment.