From 82c4a1c0322c867c336d8cc733b3c3df2e9fc17d Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Mon, 14 Dec 2015 14:13:56 +0100 Subject: [PATCH] safety measure for ZombieProcess exc --- psutil/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/psutil/__init__.py b/psutil/__init__.py index dde807aa3..abec6cbba 100644 --- a/psutil/__init__.py +++ b/psutil/__init__.py @@ -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