Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move table output to separate function
  • Loading branch information
dpdani committed May 29, 2025
commit f5132c956f5cd16248aabd018d0164ba2bb317f4
8 changes: 6 additions & 2 deletions Lib/asyncio/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,13 @@ def display_awaited_by_tasks_table(pid: int, format_: TaskTableOutputFormat = Ta

tasks = _get_awaited_by_tasks(pid)
table = build_task_table(tasks)
if format_ != TaskTableOutputFormat.table:
if format_ == TaskTableOutputFormat.table:
_display_awaited_by_tasks_table(table)
else:
_display_awaited_by_tasks_csv(table, format_)
return


def _display_awaited_by_tasks_table(table) -> None:
# Print the table in a simple tabular format
print(
f"{_header[0]:<10} {_header[1]:<20} {_header[2]:<20} {_header[3]:<50} {_header[4]:<20} {_header[5]:<15}"
Expand Down