Skip to content

Commit 9d03238

Browse files
committed
review changes
1 parent bcae852 commit 9d03238

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎Lib/asyncio/tools.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,13 @@ def get_all_awaited_by(pid):
157157
return unwinder.get_all_awaited_by()
158158

159159

160-
def build_async_tree(result, task_emoji="(T)", cor_emoji=""):
160+
def build_async_tree(result, task_emoji="(T)", cor_emoji="", fut_emoji="(F)"):
161161
"""
162162
Build a list of strings for pretty-print an async call tree.
163163
164164
The call tree is produced by `get_all_async_stacks()`, prefixing tasks
165-
with `task_emoji` and coroutine frames with `cor_emoji`.
165+
with `task_emoji`, futures with `fut_emoji`, and coroutine frames with
166+
`cor_emoji`.
166167
"""
167168
id2name, awaits, task_stacks = _index(result)
168169
g = _task_graph(awaits)
@@ -180,7 +181,7 @@ def build_async_tree(result, task_emoji="(T)", cor_emoji=""):
180181
def pretty(node):
181182
flag = task_emoji if node[0] == NodeType.TASK else cor_emoji
182183
if node[0] == NodeType.TASK and node[1] in future_ids:
183-
flag = "(F)"
184+
flag = fut_emoji
184185
return f"{flag} {labels[node]}"
185186

186187
def render(root):

0 commit comments

Comments
 (0)