mirror of
https://github.com/python/cpython.git
synced 2025-08-25 19:24:42 +00:00
bpo-36932: use proper deprecation-removed directive (GH-13349)
.. And update some deprecation warnings with version numbers. https://bugs.python.org/issue36932
This commit is contained in:
parent
3099ae4075
commit
d0ebf13e50
3 changed files with 31 additions and 24 deletions
|
@ -95,7 +95,7 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
|
|||
|
||||
None is returned when called not in the context of a Task.
|
||||
"""
|
||||
warnings.warn("Task.current_task() is deprecated, "
|
||||
warnings.warn("Task.current_task() is deprecated since Python 3.7, "
|
||||
"use asyncio.current_task() instead",
|
||||
DeprecationWarning,
|
||||
stacklevel=2)
|
||||
|
@ -109,7 +109,7 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
|
|||
|
||||
By default all tasks for the current event loop are returned.
|
||||
"""
|
||||
warnings.warn("Task.all_tasks() is deprecated, "
|
||||
warnings.warn("Task.all_tasks() is deprecated since Python 3.7, "
|
||||
"use asyncio.all_tasks() instead",
|
||||
DeprecationWarning,
|
||||
stacklevel=2)
|
||||
|
@ -388,8 +388,8 @@ async def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED):
|
|||
if loop is None:
|
||||
loop = events.get_running_loop()
|
||||
else:
|
||||
warnings.warn("The loop argument is deprecated and scheduled for "
|
||||
"removal in Python 3.10.",
|
||||
warnings.warn("The loop argument is deprecated since Python 3.8, "
|
||||
"and scheduled for removal in Python 3.10.",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
|
||||
fs = {ensure_future(f, loop=loop) for f in set(fs)}
|
||||
|
@ -418,8 +418,8 @@ async def wait_for(fut, timeout, *, loop=None):
|
|||
if loop is None:
|
||||
loop = events.get_running_loop()
|
||||
else:
|
||||
warnings.warn("The loop argument is deprecated and scheduled for "
|
||||
"removal in Python 3.10.",
|
||||
warnings.warn("The loop argument is deprecated since Python 3.8, "
|
||||
"and scheduled for removal in Python 3.10.",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
|
||||
if timeout is None:
|
||||
|
@ -600,8 +600,8 @@ async def sleep(delay, result=None, *, loop=None):
|
|||
if loop is None:
|
||||
loop = events.get_running_loop()
|
||||
else:
|
||||
warnings.warn("The loop argument is deprecated and scheduled for "
|
||||
"removal in Python 3.10.",
|
||||
warnings.warn("The loop argument is deprecated since Python 3.8, "
|
||||
"and scheduled for removal in Python 3.10.",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
|
||||
future = loop.create_future()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue