summaryrefslogtreecommitdiff
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-11 00:21:27 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-07-11 00:21:27 +0200
commitc39ba7d611fe556314acc8c11cd9f805512db663 (patch)
tree21dc6e07bea4dae7705aa9ccd26326d05303f6aa /Lib/asyncio/tasks.py
parentf68bd88aa61ae6214d3dc5552a7e3f9cf1401507 (diff)
downloadcpython-git-c39ba7d611fe556314acc8c11cd9f805512db663.tar.gz
asyncio: sync with Tulip
- repr(Task) and repr(CoroWrapper) now also includes where these objects were created. If the coroutine is not a generator (don't use "yield from"), use the location of the function, not the location of the coro() wrapper. - Fix create_task(): truncate the traceback to hide the call to create_task().
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index befc2967c7..61f48223ca 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -101,7 +101,12 @@ class Task(futures.Future):
else:
info.append(self._state.lower())
- info.append(coroutines._format_coroutine(self._coro))
+ coro = coroutines._format_coroutine(self._coro)
+ info.append('coro=<%s>' % coro)
+
+ if self._source_traceback:
+ frame = self._source_traceback[-1]
+ info.append('created at %s:%s' % (frame[0], frame[1]))
if self._state == futures._FINISHED:
info.append(self._format_result())