diff options
author | Ćukasz Langa <lukasz@langa.pl> | 2017-05-23 07:36:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-23 07:36:18 (GMT) |
commit | 219ed80637102127786d67464822a9ec5878aaa7 (patch) | |
tree | c54865a0bb670e845240f639d1f542eb35f4c7c6 | |
parent | b090349b6a7011fdd3470de0c4a181f871d60572 (diff) | |
download | cpython-219ed80637102127786d67464822a9ec5878aaa7.zip cpython-219ed80637102127786d67464822a9ec5878aaa7.tar.gz cpython-219ed80637102127786d67464822a9ec5878aaa7.tar.bz2 |
[3.5] call remove_done_callback in finally section (GH-1688) (#1758)
(cherry picked from commit 21b3e04c13212b29e8c35ffc36eed8603fde08f4)
-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 50153f8..26a6f1e 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -459,7 +459,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.') |