Skip to content

Commit

Permalink
[3.5] call remove_done_callback in finally section (pythonGH-1688)
Browse files Browse the repository at this point in the history
(cherry picked from commit 21b3e04)
  • Loading branch information
jimmylai authored and Lukasz Langa committed May 23, 2017
1 parent 32dcf42 commit 997c195
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 @@ -459,7 +459,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 997c195

Please sign in to comment.