Skip to content

[3.5] bpo-30048: asyncio: fix Task.cancel() was ignored. #1547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2017

Conversation

methane
Copy link
Member

@methane methane commented May 11, 2017

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)
(original: 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)
@methane methane changed the title bpo-30048: asyncio: fix Task.cancel() was ignored. [3.5] bpo-30048: asyncio: fix Task.cancel() was ignored. May 11, 2017
@methane methane merged commit 5e94ded into python:3.5 May 12, 2017
@methane methane deleted the py35-30048 branch May 12, 2017 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants