diff options
-rw-r--r-- | Lib/asyncio/tasks.py | 3 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2019-04-12-13-52-15.bpo-36613.hqT1qn.rst | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index d850837..007a459 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -495,10 +495,11 @@ async def _wait(fs, timeout, return_when, loop): finally: if timeout_handle is not None: timeout_handle.cancel() + for f in fs: + f.remove_done_callback(_on_completion) done, pending = set(), set() for f in fs: - f.remove_done_callback(_on_completion) if f.done(): done.add(f) else: diff --git a/Misc/NEWS.d/next/Library/2019-04-12-13-52-15.bpo-36613.hqT1qn.rst b/Misc/NEWS.d/next/Library/2019-04-12-13-52-15.bpo-36613.hqT1qn.rst new file mode 100644 index 0000000..8828dcc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-04-12-13-52-15.bpo-36613.hqT1qn.rst @@ -0,0 +1 @@ +Fix :mod:`asyncio` wait() not removing callback if exception
\ No newline at end of file |