Skip to content

Commit

Permalink
call remove_done_callback in finally section (python#1688)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmylai authored and ambv committed May 23, 2017
1 parent 002665a commit 21b3e04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/asyncio/base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ def run_until_complete(self, future):
# local task.
future.exception()
raise
future.remove_done_callback(_run_until_complete_cb)
finally:
future.remove_done_callback(_run_until_complete_cb)
if not future.done():
raise RuntimeError('Event loop stopped before Future completed.')

Expand Down

0 comments on commit 21b3e04

Please sign in to comment.