summaryrefslogtreecommitdiff
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-08 19:16:37 -0500
committerYury Selivanov <yury@magic.io>2016-11-08 19:16:37 -0500
commitbb5e522d45c26d66a867f899726631924e46a462 (patch)
treefee9b57d91af79453f4e92c4a045b96cd4b970d9 /Lib/asyncio
parentbff8f647a97bbb7fb91d0a02b6133e5312410ca7 (diff)
parenta054f40e84b924996f372ba10da969b6b05f77e6 (diff)
downloadcpython-git-bb5e522d45c26d66a867f899726631924e46a462.tar.gz
Merge 3.6 (asyncio)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/coroutines.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py
index 167c1e44e2..2fc76ad726 100644
--- a/Lib/asyncio/coroutines.py
+++ b/Lib/asyncio/coroutines.py
@@ -262,8 +262,12 @@ def _format_coroutine(coro):
assert iscoroutine(coro)
if not hasattr(coro, 'cr_code') and not hasattr(coro, 'gi_code'):
- # Most likely a Cython coroutine.
- coro_name = getattr(coro, '__qualname__', coro.__name__)
+ # Most likely a built-in type or a Cython coroutine.
+
+ # Built-in types might not have __qualname__ or __name__.
+ coro_name = getattr(
+ coro, '__qualname__',
+ getattr(coro, '__name__', type(coro).__name__))
coro_name = '{}()'.format(coro_name)
running = False