summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-09 00:16:15 (GMT)
committerYury Selivanov <yury@magic.io>2016-11-09 00:16:15 (GMT)
commita054f40e84b924996f372ba10da969b6b05f77e6 (patch)
treeeb85c8340bbba9ee8ac822d86a5be171a14132ad /Lib/asyncio
parent692796a948ab67d75f7010e96b31885eefbd88e5 (diff)
parent6cc495e9e2db8de0b8b7d95323d3a1514844b1b4 (diff)
downloadcpython-a054f40e84b924996f372ba10da969b6b05f77e6.zip
cpython-a054f40e84b924996f372ba10da969b6b05f77e6.tar.gz
cpython-a054f40e84b924996f372ba10da969b6b05f77e6.tar.bz2
Merge 3.5 (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 167c1e4..2fc76ad 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