Skip to content

Commit

Permalink
Merge pull request #240 from mulkieran/cmdline-None
Browse files Browse the repository at this point in the history
terminate_traces: Do not fail if cmdline is None
  • Loading branch information
mulkieran authored Feb 15, 2024
2 parents d68e1a2 + 0e92f9d commit 0a5408b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion testlib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def terminate_traces(name):
"""
for proc in psutil.process_iter(["cmdline"]):
try:
if any(name == param for param in proc.info["cmdline"]):
cmdline = proc.info["cmdline"]
if cmdline is not None and any(name == param for param in cmdline):
proc.terminate()
except psutil.NoSuchProcess:
pass
Expand Down

0 comments on commit 0a5408b

Please sign in to comment.