From ff66901d8a8753c11d4411e62376b26f17aa90cf Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 13 Apr 2025 09:41:26 +0200 Subject: [PATCH] [3.13] gh-132354: document return value for `asyncio.Task.cancel` (GH-132374) (#132465) gh-132354: document return value for `asyncio.Task.cancel` (GH-132374) (cherry picked from commit 64b066ad298506f715647c9a2524c9fbbc764cc2) Co-authored-by: Felix Scherz --- Doc/library/asyncio-task.rst | 5 ++++- Misc/ACKS | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index ddba9f20a3c0..6c83ab94af39 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -1336,7 +1336,10 @@ Task Object Request the Task to be cancelled. - This arranges for a :exc:`CancelledError` exception to be thrown + If the Task is already *done* or *cancelled*, return ``False``, + otherwise, return ``True``. + + The method arranges for a :exc:`CancelledError` exception to be thrown into the wrapped coroutine on the next cycle of the event loop. The coroutine then has a chance to clean up or even deny the diff --git a/Misc/ACKS b/Misc/ACKS index f236c6400c2b..3adb168f33c4 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1644,6 +1644,7 @@ Andreas Schawo Neil Schemenauer David Scherer Wolfgang Scherer +Felix Scherz Hynek Schlawack Bob Schmertz Gregor Schmid -- 2.47.3