]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46771: Remove two controversial lines from Task.cancel() (GH-31623)
authorGuido van Rossum <guido@python.org>
Mon, 28 Feb 2022 23:15:56 +0000 (15:15 -0800)
committerGitHub <noreply@github.com>
Mon, 28 Feb 2022 23:15:56 +0000 (15:15 -0800)
commit7d611b4cabaf7925f5f94daddf711d54aeae2cf9
tree4c8a48847d780e1a2632a15d8ae2b551bc224ad8
parent08deed1af56bec8668c6cb4d5cfd89e393e1fe5e
bpo-46771: Remove two controversial lines from Task.cancel() (GH-31623)

Also from the _asyncio C accelerator module,
and adjust one test that the change caused to fail.

For more discussion see the discussion starting here:
https://github.com/python/cpython/pull/31394#issuecomment-1053545331

(Basically, @asvetlov proposed to return False from cancel()
when there is already a pending cancellation, and I went along,
even though it wasn't necessary for the task group implementation,
and @agronholm has come up with a counterexample that fails
because of this change.  So now I'm changing it back to the old
semantics (but still bumping the counter) until we can have a
proper discussion about this.)
Lib/asyncio/tasks.py
Lib/test/test_asyncio/test_tasks.py
Modules/_asynciomodule.c