From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 9 Apr 2026 15:21:16 +0000 (+0200) Subject: [3.14] gh-148091: clarify asyncio.Future.cancel(msg) behaviour (GH-148248) (#148299) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b87590fd275b992364b716ea79341fd6069009c5;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-148091: clarify asyncio.Future.cancel(msg) behaviour (GH-148248) (#148299) gh-148091: clarify asyncio.Future.cancel(msg) behaviour (GH-148248) (cherry picked from commit 2acb8d9257c4f5049777d9d462092373b0b3feca) Co-authored-by: Manoj K M <136242596+manoj-k-m@users.noreply.github.com> --- diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst index 4b69e569523c..43977de273e6 100644 --- a/Doc/library/asyncio-future.rst +++ b/Doc/library/asyncio-future.rst @@ -196,6 +196,10 @@ Future Object Otherwise, change the Future's state to *cancelled*, schedule the callbacks, and return ``True``. + The optional string argument *msg* is passed as the argument to the + :exc:`CancelledError` exception raised when a cancelled Future + is awaited. + .. versionchanged:: 3.9 Added the *msg* parameter.