mirror of https://github.com/python/cpython.git
call remove_done_callback in finally section (#1688)
This commit is contained in:
parent
002665a9da
commit
21b3e04c13
|
@ -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.')
|
||||
|
||||
|
|
Loading…
Reference in New Issue