diff options
author | Yury Selivanov <yury@magic.io> | 2016-09-15 13:49:08 -0400 |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-09-15 13:49:08 -0400 |
commit | 4357cf62028964eb1a56c503ec1296de3034b77b (patch) | |
tree | df72b686e2038e28047ceca7b462263a02d8f4dc /Lib/asyncio/tasks.py | |
parent | f6d991d88502ee05da7c41217331ff024c634cbc (diff) | |
download | cpython-git-4357cf62028964eb1a56c503ec1296de3034b77b.tar.gz |
Another asyncio sync.
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r-- | Lib/asyncio/tasks.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 35c945c436..4c66546428 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -519,7 +519,7 @@ def sleep(delay, result=None, *, loop=None): h.cancel() -def async(coro_or_future, *, loop=None): +def async_(coro_or_future, *, loop=None): """Wrap a coroutine in a future. If the argument is a Future, it is returned directly. @@ -532,6 +532,11 @@ def async(coro_or_future, *, loop=None): return ensure_future(coro_or_future, loop=loop) +# Silence DeprecationWarning: +globals()['async'] = async_ +async_.__name__ = 'async' +del async_ + def ensure_future(coro_or_future, *, loop=None): """Wrap a coroutine or an awaitable in a future. |