Skip to content

Commit

Permalink
Handle the case pinfo[cmdline] == None correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannah Bast committed Mar 27, 2024
1 parent 9ccd486 commit 4903a64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qlever/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def show_table_line(pid, user, start_time, rss, cmdline):
pinfo = psutil_process.as_dict(
attrs=['pid', 'username', 'create_time',
'memory_info', 'cmdline'])
cmdline = " ".join(pinfo['cmdline'])
# Note: `cmdline` can be empty if the process is a zombie.
# Note: pinfo[`cmdline`] is `None` if the process is a zombie.
cmdline = " ".join(pinfo['cmdline'] or [])
if len(cmdline) == 0 or not re.search(cmdline_regex, cmdline):
return False
pid = pinfo['pid']
Expand Down

0 comments on commit 4903a64

Please sign in to comment.