diff --git a/bottle.py b/bottle.py index 2e0ca610e..07c022e56 100644 --- a/bottle.py +++ b/bottle.py @@ -18,6 +18,10 @@ import logging import signal from aiohttp.wsgi import WSGIServerHttpProtocol +try: + from asyncio.coroutines import CoroWrapper +except ImportError: + from asyncio.tasks import CoroWrapper import asyncio __author__ = 'Marcel Hellkamp' @@ -2604,7 +2608,7 @@ def wrapper(*a, **ka): def yields(value): return isinstance(value, asyncio.futures.Future) or inspect.isgenerator(value) or \ - isinstance(value, asyncio.tasks.CoroWrapper) + isinstance(value, CoroWrapper) @asyncio.coroutine def call_maybe_yield(func, *args, **kwargs):