summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/coroutines.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2016-03-02 15:49:16 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2016-03-02 15:49:16 (GMT)
commitdce63234c55db7395ccc62d5e6e96c19696871e8 (patch)
tree3453ea06db7753a0aa633c4f2f5969f99e22bed9 /Lib/asyncio/coroutines.py
parent0c6a34409ea9cf9a82171da09801f086d472aa89 (diff)
downloadcpython-dce63234c55db7395ccc62d5e6e96c19696871e8.zip
cpython-dce63234c55db7395ccc62d5e6e96c19696871e8.tar.gz
cpython-dce63234c55db7395ccc62d5e6e96c19696871e8.tar.bz2
asyncio: Fix @coroutine to recognize CoroWrapper (issue #25647)
Patch by Vladimir Rutsky.
Diffstat (limited to 'Lib/asyncio/coroutines.py')
-rw-r--r--Lib/asyncio/coroutines.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py
index 27ab42a..71bc6fb 100644
--- a/Lib/asyncio/coroutines.py
+++ b/Lib/asyncio/coroutines.py
@@ -204,7 +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):
+ if isinstance(res, futures.Future) 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