Skip to content

Commit f5132c9

Browse files
committed
Move table output to separate function
1 parent 4b77995 commit f5132c9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/asyncio/tools.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,13 @@ def display_awaited_by_tasks_table(pid: int, format_: TaskTableOutputFormat = Ta
219219

220220
tasks = _get_awaited_by_tasks(pid)
221221
table = build_task_table(tasks)
222-
if format_ != TaskTableOutputFormat.table:
222+
if format_ == TaskTableOutputFormat.table:
223+
_display_awaited_by_tasks_table(table)
224+
else:
223225
_display_awaited_by_tasks_csv(table, format_)
224-
return
226+
227+
228+
def _display_awaited_by_tasks_table(table) -> None:
225229
# Print the table in a simple tabular format
226230
print(
227231
f"{_header[0]:<10} {_header[1]:<20} {_header[2]:<20} {_header[3]:<50} {_header[4]:<20} {_header[5]:<15}"

0 commit comments

Comments
 (0)