diff options
author | Yury Selivanov <yury@magic.io> | 2016-09-15 17:49:08 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-09-15 17:49:08 (GMT) |
commit | 4357cf62028964eb1a56c503ec1296de3034b77b (patch) | |
tree | df72b686e2038e28047ceca7b462263a02d8f4dc /Lib/asyncio/tasks.py | |
parent | f6d991d88502ee05da7c41217331ff024c634cbc (diff) | |
download | cpython-4357cf62028964eb1a56c503ec1296de3034b77b.zip cpython-4357cf62028964eb1a56c503ec1296de3034b77b.tar.gz cpython-4357cf62028964eb1a56c503ec1296de3034b77b.tar.bz2 |
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 35c945c..4c66546 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. |