diff options
author | Kyle Stanley <aeros167@gmail.com> | 2019-12-30 11:50:19 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2019-12-30 11:50:19 (GMT) |
commit | 89aa7f0ede1a11c020e83f24394593c577a61509 (patch) | |
tree | e570c3365f871fa9e7c82909e48d81c85f3ad718 /Lib/asyncio/tasks.py | |
parent | 88dce26da6bc4838092128d9a6f1c98bf48b7c90 (diff) | |
download | cpython-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.py | 6 |
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) |