summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorKyle Stanley <aeros167@gmail.com>2019-12-30 11:50:19 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2019-12-30 11:50:19 (GMT)
commit89aa7f0ede1a11c020e83f24394593c577a61509 (patch)
treee570c3365f871fa9e7c82909e48d81c85f3ad718 /Lib/asyncio/tasks.py
parent88dce26da6bc4838092128d9a6f1c98bf48b7c90 (diff)
downloadcpython-89aa7f0ede1a11c020e83f24394593c577a61509.zip
cpython-89aa7f0ede1a11c020e83f24394593c577a61509.tar.gz
cpython-89aa7f0ede1a11c020e83f24394593c577a61509.tar.bz2
bpo-34790: Implement deprecation of passing coroutines to asyncio.wait() (GH-16977)
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index 894d28e..717837d 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -424,6 +424,12 @@ async def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED):
"and scheduled for removal in Python 3.10.",
DeprecationWarning, stacklevel=2)
+ if any(coroutines.iscoroutine(f) for f in set(fs)):
+ warnings.warn("The explicit passing of coroutine objects to "
+ "asyncio.wait() is deprecated since Python 3.8, and "
+ "scheduled for removal in Python 3.11.",
+ DeprecationWarning, stacklevel=2)
+
fs = {ensure_future(f, loop=loop) for f in set(fs)}
return await _wait(fs, timeout, return_when, loop)