summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-05-01 00:59:33 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2016-05-01 00:59:33 +0200
commit1272150610283c842a1d5f71a213414b81c0566b (patch)
tree0ef44375af575d57eafc20a2a514ac6b91522683
parentc0ac3f7d71457c250b54fc3b2da11340a43a284e (diff)
downloadpsutil-1272150610283c842a1d5f71a213414b81c0566b.tar.gz
set ppid
-rw-r--r--psutil/_psbsd.py3
-rw-r--r--psutil/_psosx.py3
-rw-r--r--psutil/_pssunos.py3
3 files changed, 6 insertions, 3 deletions
diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py
index 76d6d588..990ecd51 100644
--- a/psutil/_psbsd.py
+++ b/psutil/_psbsd.py
@@ -463,7 +463,8 @@ class Process(object):
@wrap_exceptions
def ppid(self):
- return cext.proc_ppid(self.pid)
+ self._ppid = cext.proc_ppid(self.pid)
+ return self._ppid
@wrap_exceptions
def uids(self):
diff --git a/psutil/_psosx.py b/psutil/_psosx.py
index 77e5ed58..c5021ce1 100644
--- a/psutil/_psosx.py
+++ b/psutil/_psosx.py
@@ -250,7 +250,8 @@ class Process(object):
@wrap_exceptions
def ppid(self):
- return cext.proc_ppid(self.pid)
+ self._ppid = cext.proc_ppid(self.pid)
+ return self._ppid
@wrap_exceptions
def cwd(self):
diff --git a/psutil/_pssunos.py b/psutil/_pssunos.py
index bca54527..82fa38f7 100644
--- a/psutil/_pssunos.py
+++ b/psutil/_pssunos.py
@@ -359,7 +359,8 @@ class Process(object):
@wrap_exceptions
def ppid(self):
- return cext.proc_basic_info(self.pid, self._procfs_path)[0]
+ self._ppid = cext.proc_basic_info(self.pid, self._procfs_path)[0]
+ return self._ppid
@wrap_exceptions
def uids(self):