diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-07-11 00:21:27 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-07-11 00:21:27 +0200 |
commit | c39ba7d611fe556314acc8c11cd9f805512db663 (patch) | |
tree | 21dc6e07bea4dae7705aa9ccd26326d05303f6aa /Lib/asyncio/tasks.py | |
parent | f68bd88aa61ae6214d3dc5552a7e3f9cf1401507 (diff) | |
download | cpython-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.py | 7 |
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()) |