aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/discord/utils.py b/discord/utils.py
index d7d23e87..66c235bb 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -266,10 +266,11 @@ def _parse_ratelimit_header(request):
@asyncio.coroutine
def maybe_coroutine(f, *args, **kwargs):
- if asyncio.iscoroutinefunction(f):
- return (yield from f(*args, **kwargs))
+ value = f(*args, **kwargs)
+ if asyncio.iscoroutine(value):
+ return (yield from value)
else:
- return f(*args, **kwargs)
+ return value
@asyncio.coroutine
def async_all(gen):