Skip to content

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

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 1 commit into from
May 11, 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 pull request was: 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 merged commit 3dc7c52 into python:3.6 May 11, 2017
@methane methane deleted the py36-30048 branch May 11, 2017 12:56
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