diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py index 76d6d588c..990ecd51b 100644 --- a/psutil/_psbsd.py +++ b/psutil/_psbsd.py @@ -463,7 +463,8 @@ def terminal(self): @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 77e5ed58e..c5021ce14 100644 --- a/psutil/_psosx.py +++ b/psutil/_psosx.py @@ -250,7 +250,8 @@ def environ(self): @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 bca545272..82fa38f7a 100644 --- a/psutil/_pssunos.py +++ b/psutil/_pssunos.py @@ -359,7 +359,8 @@ def nice_set(self, value): @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):