mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
Merge asyncio upstream.
This commit is contained in:
parent
9b32bda851
commit
7b3b3dc85d
6 changed files with 94 additions and 14 deletions
|
@ -204,8 +204,8 @@ def coroutine(func):
|
|||
@functools.wraps(func)
|
||||
def coro(*args, **kw):
|
||||
res = func(*args, **kw)
|
||||
if isinstance(res, futures.Future) or inspect.isgenerator(res) or \
|
||||
isinstance(res, CoroWrapper):
|
||||
if (futures.isfuture(res) or inspect.isgenerator(res) or
|
||||
isinstance(res, CoroWrapper)):
|
||||
res = yield from res
|
||||
elif _AwaitableABC is not None:
|
||||
# If 'func' returns an Awaitable (new in 3.5) we
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue