Skip to content

Commit

Permalink
Merge pull request #39 from bseidenberg/master
Browse files Browse the repository at this point in the history
Fix crash opening windows on systems with zombie processes
  • Loading branch information
mbridak authored Oct 29, 2023
2 parents ee7c41b + 9beee3d commit 97013b5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ def check_process(name: str) -> bool:
Bool
"""
for proc in psutil.process_iter():
if len(proc.cmdline()) == 2:
if name in proc.cmdline()[1]:
return True
try:
if len(proc.cmdline()) == 2:
if name in proc.cmdline()[1]:
return True
except psutil.NoSuchProcess:
continue
except psutil.ZombieProcess:
continue
return False


Expand Down

0 comments on commit 97013b5

Please sign in to comment.