Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure nprocess exists when table is empty. #444

Merged
merged 3 commits into from
Dec 25, 2023
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
Next Next commit
ensure nprocess exists when table is empty.
  • Loading branch information
dmbuck32 committed Sep 3, 2023
commit 46a5c5cb3a599b18b394fb3ef2ae32a5185ccf08
2 changes: 2 additions & 0 deletions jtop/gui/lib/process_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def draw(self, pos_y, pos_x, width, height, key, mouse):
# Sort table for selected line
sorted_processes = sorted(processes, key=lambda x: x[self.line_sort], reverse=self.type_reverse)
# Draw all processes
# Instantiate the number of process variable to avoid an unbound local error if the process table is empty.
nprocess = 0
for nprocess, process in enumerate(sorted_processes):
# Skip unit size process
counter = 0
Expand Down