From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 13 Apr 2025 07:41:26 +0000 (+0200) Subject: [3.13] gh-132354: document return value for `asyncio.Task.cancel` (GH-132374) (#132465) X-Git-Tag: v3.13.4~285 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff66901d8a8753c11d4411e62376b26f17aa90cf;p=thirdparty%2FPython%2Fcpython.git [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 --- 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