diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-05-24 22:42:41 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-05-24 22:42:41 +0200 |
commit | 97d2284534fe1ebafd4bf466461390e7b0a66d7f (patch) | |
tree | 453f9ec7ae9e7abc9f400d849dac820bb4c3d4fa /psutil/_psbsd.py | |
parent | 7d081114d708c60761e355c555d73ea29460d9a0 (diff) | |
download | psutil-wheel5.tar.gz |
maybe we have a zombie process detection on OSXwheel5
Diffstat (limited to 'psutil/_psbsd.py')
-rw-r--r-- | psutil/_psbsd.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py index 49ad1e99..d53eb042 100644 --- a/psutil/_psbsd.py +++ b/psutil/_psbsd.py @@ -551,10 +551,10 @@ def wrap_exceptions(fun): try: return fun(self, *args, **kwargs) except ProcessLookupError: - if not pid_exists(self.pid): - raise NoSuchProcess(self.pid, self._name) - else: + if is_zombie(self.pid): raise ZombieProcess(self.pid, self._name, self._ppid) + else: + raise NoSuchProcess(self.pid, self._name) except PermissionError: raise AccessDenied(self.pid, self._name) except OSError: @@ -576,10 +576,10 @@ def wrap_exceptions_procfs(inst): # ENOENT (no such file or directory) gets raised on open(). # ESRCH (no such process) can get raised on read() if # process is gone in meantime. - if not pid_exists(inst.pid): - raise NoSuchProcess(inst.pid, inst._name) - else: + if is_zombie(inst.pid): raise ZombieProcess(inst.pid, inst._name, inst._ppid) + else: + raise NoSuchProcess(inst.pid, inst._name) except PermissionError: raise AccessDenied(inst.pid, inst._name) |