From: Mariatta Wijaya Date: Tue, 7 Feb 2017 06:03:00 +0000 (-0800) Subject: Issue #29314: Set the stacklevel to two in asyncio.async() Deprecation Warning X-Git-Tag: v3.6.1rc1~98^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e7ff8b1a31ae9c11164940d4171df13b9c1e277;p=python Issue #29314: Set the stacklevel to two in asyncio.async() Deprecation Warning --- diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 8852aa5ad2..7b3bdb2186 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -535,7 +535,8 @@ def async_(coro_or_future, *, loop=None): """ warnings.warn("asyncio.async() function is deprecated, use ensure_future()", - DeprecationWarning) + DeprecationWarning, + stacklevel=2) return ensure_future(coro_or_future, loop=loop)