mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
bpo-47039: Normalize repr() of asyncio future and task objects (GH-31950)
This commit is contained in:
parent
a7c5414832
commit
30b5d41fab
7 changed files with 42 additions and 118 deletions
|
@ -1,4 +1,5 @@
|
|||
import linecache
|
||||
import reprlib
|
||||
import traceback
|
||||
|
||||
from . import base_futures
|
||||
|
@ -22,6 +23,12 @@ def _task_repr_info(task):
|
|||
return info
|
||||
|
||||
|
||||
@reprlib.recursive_repr()
|
||||
def _task_repr(task):
|
||||
info = ' '.join(_task_repr_info(task))
|
||||
return f'<{task.__class__.__name__} {info}>'
|
||||
|
||||
|
||||
def _task_get_stack(task, limit):
|
||||
frames = []
|
||||
if hasattr(task._coro, 'cr_frame'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue