From 866142546ade2b40f911712f03308fd7f1a35e77 Mon Sep 17 00:00:00 2001 From: Mariatta Wijaya Date: Mon, 6 Feb 2017 22:03:00 -0800 Subject: Issue #29314: Set the stacklevel to two in asyncio.async() Deprecation Warning --- Lib/asyncio/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1