aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index e876f8d002c..27fe58da151 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -207,6 +207,11 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
This also increases the task's count of cancellation requests.
"""
+ if msg is not None:
+ warnings.warn("Passing 'msg' argument to Task.cancel() "
+ "is deprecated since Python 3.11, and "
+ "scheduled for removal in Python 3.14.",
+ DeprecationWarning, stacklevel=2)
self._log_traceback = False
if self.done():
return False