]> granicus.if.org Git - python/commitdiff
Issue #29314: Set the stacklevel to two in asyncio.async() Deprecation Warning
authorMariatta Wijaya <mariatta.wijaya@gmail.com>
Tue, 7 Feb 2017 06:03:00 +0000 (22:03 -0800)
committerMariatta Wijaya <mariatta.wijaya@gmail.com>
Tue, 7 Feb 2017 06:03:00 +0000 (22:03 -0800)
Lib/asyncio/tasks.py

index 8852aa5ad2a2eb1e3a2760585048f626005afca4..7b3bdb21865a4910c802e75b304595141d3fe627 100644 (file)
@@ -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)