mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #29314: Set the stacklevel to two in asyncio.async() Deprecation Warning
This commit is contained in:
parent
81b8977349
commit
4e7ff8b1a3
1 changed files with 2 additions and 1 deletions
|
@ -535,7 +535,8 @@ def async_(coro_or_future, *, loop=None):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
warnings.warn("asyncio.async() function is deprecated, use ensure_future()",
|
warnings.warn("asyncio.async() function is deprecated, use ensure_future()",
|
||||||
DeprecationWarning)
|
DeprecationWarning,
|
||||||
|
stacklevel=2)
|
||||||
|
|
||||||
return ensure_future(coro_or_future, loop=loop)
|
return ensure_future(coro_or_future, loop=loop)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue