[3.5] bpo-30048: asyncio: fix Task.cancel() was ignored. by methane · Pull Request #1547 · python/cpython
when there are no more `await` or `yield (from)` before return in coroutine,
cancel was ignored.
example:
async def coro():
asyncio.Task.current_task().cancel()
return 42
...
res = await coro() # should raise CancelledError
(cherry picked from commit 991adca)
methane
changed the title
bpo-30048: asyncio: fix Task.cancel() was ignored.
[3.5] bpo-30048: asyncio: fix Task.cancel() was ignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters