Skip to content

Commit

Permalink
safety measure for ZombieProcess exc
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Dec 14, 2015
1 parent 162cd64 commit 82c4a1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ def is_running(self):
# Process identity / uniqueness over time is guaranteed by
# (PID + creation time) and that is verified in __eq__.
return self == Process(self.pid)
except ZombieProcess:
# We should never get here as it's already handled in
# Process.__init__; here just for extra safety.
return True
except NoSuchProcess:
self._gone = True
return False
Expand Down

0 comments on commit 82c4a1c

Please sign in to comment.