diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-07-10 22:21:27 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-07-10 22:21:27 (GMT) |
commit | c39ba7d611fe556314acc8c11cd9f805512db663 (patch) | |
tree | 21dc6e07bea4dae7705aa9ccd26326d05303f6aa /Lib/asyncio/base_events.py | |
parent | f68bd88aa61ae6214d3dc5552a7e3f9cf1401507 (diff) | |
download | cpython-c39ba7d611fe556314acc8c11cd9f805512db663.zip cpython-c39ba7d611fe556314acc8c11cd9f805512db663.tar.gz cpython-c39ba7d611fe556314acc8c11cd9f805512db663.tar.bz2 |
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/base_events.py')
-rw-r--r-- | Lib/asyncio/base_events.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 833f81d..f6d7a58 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -155,7 +155,10 @@ class BaseEventLoop(events.AbstractEventLoop): """Schedule a coroutine object. Return a task object.""" - return tasks.Task(coro, loop=self) + task = tasks.Task(coro, loop=self) + if task._source_traceback: + del task._source_traceback[-1] + return task def _make_socket_transport(self, sock, protocol, waiter=None, *, extra=None, server=None): |