mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue