[Python-checkins] cpython (3.5): Issue #29314: Set the stacklevel to two in asyncio.async() Deprecation Warning

mariatta.wijaya python-checkins at python.org
Tue Feb 7 01:06:37 EST 2017


https://hg.python.org/cpython/rev/0f5161f865d7
changeset:   106460:0f5161f865d7
branch:      3.5
parent:      106456:df62e833eeb1
user:        Mariatta Wijaya <mariatta.wijaya at gmail.com>
date:        Mon Feb 06 22:03:00 2017 -0800
summary:
  Issue #29314: Set the stacklevel to two in asyncio.async() Deprecation Warning

files:
  Lib/asyncio/tasks.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -535,7 +535,8 @@
     """
 
     warnings.warn("asyncio.async() function is deprecated, use ensure_future()",
-                  DeprecationWarning)
+                  DeprecationWarning,
+                  stacklevel=2)
 
     return ensure_future(coro_or_future, loop=loop)
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list