mirror of
https://github.com/python/cpython.git
synced 2025-10-11 17:32:49 +00:00
Another asyncio sync.
This commit is contained in:
parent
f6d991d885
commit
4357cf6202
2 changed files with 11 additions and 5 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue