diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py index 223943511..b540bdac2 100644 --- a/psutil/_pswindows.py +++ b/psutil/_pswindows.py @@ -248,9 +248,7 @@ def exe(self): # see https://github.com/giampaolo/psutil/issues/414 # see https://github.com/giampaolo/psutil/issues/528 - if self.pid == 0: - raise AccessDenied(self.pid, self._name) - elif self.pid == 4: + if self.pid in (0, 4): raise AccessDenied(self.pid, self._name) return _convert_raw_path(cext.proc_exe(self.pid))