Another asyncio sync.

This commit is contained in:
Yury Selivanov 2016-09-15 13:49:08 -04:00
parent f6d991d885
commit 4357cf6202
2 changed files with 11 additions and 5 deletions

View file

@ -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.