summaryrefslogtreecommitdiff
path: root/asyncio/tasks.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-10 23:43:41 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-07-10 23:43:41 +0200
commite65d26c8234754472393106ea015f5e8df5f8cef (patch)
tree7aeda6ac38077ba27f02d847c474ecf5424db138 /asyncio/tasks.py
parent91d392e997a869634256513c887887160585646f (diff)
downloadtrollius-e65d26c8234754472393106ea015f5e8df5f8cef.tar.gz
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.
Diffstat (limited to 'asyncio/tasks.py')
-rw-r--r--asyncio/tasks.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/asyncio/tasks.py b/asyncio/tasks.py
index befc296..61f4822 100644
--- a/asyncio/tasks.py
+++ b/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())