summaryrefslogtreecommitdiff
path: root/psutil/_pssunos.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2015-02-19 15:03:30 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2015-02-19 15:03:30 +0100
commit9435a1b67497c0bff7049ec4104c9f0676c37ed9 (patch)
treeb5a65c58504f52dd0c601091d0171164b844bb14 /psutil/_pssunos.py
parentad05e800b36f11b48ac58345b0ee329a8925ec82 (diff)
downloadpsutil-9435a1b67497c0bff7049ec4104c9f0676c37ed9.tar.gz
#428 / zombie process: provide a more informative exception msg providing also the PPID
Diffstat (limited to 'psutil/_pssunos.py')
-rw-r--r--psutil/_pssunos.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/psutil/_pssunos.py b/psutil/_pssunos.py
index 4c2920a2..fbb31f1f 100644
--- a/psutil/_pssunos.py
+++ b/psutil/_pssunos.py
@@ -262,7 +262,7 @@ def wrap_exceptions(fun):
if not pid_exists(self.pid):
raise NoSuchProcess(self.pid, self._name)
else:
- raise ZombieProcess(self.pid, self._name)
+ raise ZombieProcess(self.pid, self._name, self._ppid)
if err.errno in (errno.EPERM, errno.EACCES):
raise AccessDenied(self.pid, self._name)
raise
@@ -272,11 +272,12 @@ def wrap_exceptions(fun):
class Process(object):
"""Wrapper class around underlying C implementation."""
- __slots__ = ["pid", "_name"]
+ __slots__ = ["pid", "_name", "_ppid"]
def __init__(self, pid):
self.pid = pid
self._name = None
+ self._ppid = None
@wrap_exceptions
def name(self):