Skip to content

Commit 21b3e04

Browse files
jimmylaiambv
authored andcommitted
call remove_done_callback in finally section (#1688)
1 parent 002665a commit 21b3e04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/asyncio/base_events.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ def run_until_complete(self, future):
458458
# local task.
459459
future.exception()
460460
raise
461-
future.remove_done_callback(_run_until_complete_cb)
461+
finally:
462+
future.remove_done_callback(_run_until_complete_cb)
462463
if not future.done():
463464
raise RuntimeError('Event loop stopped before Future completed.')
464465

0 commit comments

Comments
 (0)