mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
bpo-34790: Implement deprecation of passing coroutines to asyncio.wait() (GH-16977)
This commit is contained in:
parent
88dce26da6
commit
89aa7f0ede
3 changed files with 28 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue