Change how coroutines are detected internally.
This commit is contained in:
parent
305cc3acfa
commit
5e913b265b
@ -266,10 +266,11 @@ def _parse_ratelimit_header(request):
|
|||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def maybe_coroutine(f, *args, **kwargs):
|
def maybe_coroutine(f, *args, **kwargs):
|
||||||
if asyncio.iscoroutinefunction(f):
|
value = f(*args, **kwargs)
|
||||||
return (yield from f(*args, **kwargs))
|
if asyncio.iscoroutine(value):
|
||||||
|
return (yield from value)
|
||||||
else:
|
else:
|
||||||
return f(*args, **kwargs)
|
return value
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_all(gen):
|
def async_all(gen):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user