From 7b3b3dc85da3ec176d7fd7caa546298c232c9c0a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 9 Sep 2016 14:26:31 -0700 Subject: Merge asyncio upstream. --- Lib/asyncio/coroutines.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/asyncio/coroutines.py') diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py index 71bc6fb2eab..72ffb44e957 100644 --- a/Lib/asyncio/coroutines.py +++ b/Lib/asyncio/coroutines.py @@ -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 -- cgit v1.2.3