diff options
author | jimmylai <albert_chs@yahoo.com.tw> | 2017-05-22 22:32:46 -0700 |
---|---|---|
committer | Ćukasz Langa <lukasz@langa.pl> | 2017-05-22 22:32:46 -0700 |
commit | 21b3e04c13212b29e8c35ffc36eed8603fde08f4 (patch) | |
tree | 312a2f63480b10ebbd79ceec8203df27e68a688c /Lib/asyncio | |
parent | 002665a9da3a2924c4a08511ede62ff4d1dabc48 (diff) | |
download | cpython-git-21b3e04c13212b29e8c35ffc36eed8603fde08f4.tar.gz |
call remove_done_callback in finally section (#1688)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/base_events.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 3ff511be44..33b8f4887c 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -458,7 +458,8 @@ class BaseEventLoop(events.AbstractEventLoop): # 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.') |