bpo-30048: asyncio: fix Task.cancel() was ignored. by methane · Pull Request #1097 · python/cpython
example:
async def coro():
asyncio.Task.current_task().cancel()
return 42
...
res = await coro() # should raise CancelledError
1st1 approved these changes May 9, 2017
methane
deleted the
asyncio-task-cancel
branch
methane added a commit to methane/cpython that referenced this pull request
May 11, 2017when 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 added a commit to methane/cpython that referenced this pull request
May 11, 2017when 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 added a commit that referenced this pull request
May 12, 2017* bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097) 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) * fix test
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