Skip to content

Commit ff66901

Browse files
[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 64b066a) Co-authored-by: Felix Scherz <felixwscherz@gmail.com>
1 parent 244a642 commit ff66901

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Doc/library/asyncio-task.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,10 @@ Task Object
13361336

13371337
Request the Task to be cancelled.
13381338

1339-
This arranges for a :exc:`CancelledError` exception to be thrown
1339+
If the Task is already *done* or *cancelled*, return ``False``,
1340+
otherwise, return ``True``.
1341+
1342+
The method arranges for a :exc:`CancelledError` exception to be thrown
13401343
into the wrapped coroutine on the next cycle of the event loop.
13411344

13421345
The coroutine then has a chance to clean up or even deny the

Misc/ACKS

+1
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,7 @@ Andreas Schawo
16441644
Neil Schemenauer
16451645
David Scherer
16461646
Wolfgang Scherer
1647+
Felix Scherz
16471648
Hynek Schlawack
16481649
Bob Schmertz
16491650
Gregor Schmid

0 commit comments

Comments
 (0)