mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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().
This commit is contained in:
parent
f68bd88aa6
commit
c39ba7d611
4 changed files with 70 additions and 15 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue