[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 64b066ad29)

Co-authored-by: Felix Scherz <felixwscherz@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-04-13 09:41:26 +02:00 committed by GitHub
parent 244a642443
commit ff66901d8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -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