summaryrefslogtreecommitdiff
path: root/psutil/_psbsd.py
diff options
context:
space:
mode:
Diffstat (limited to 'psutil/_psbsd.py')
-rw-r--r--psutil/_psbsd.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py
index 8b980b2d..57d847b9 100644
--- a/psutil/_psbsd.py
+++ b/psutil/_psbsd.py
@@ -111,7 +111,7 @@ def virtual_memory():
def swap_memory():
"""System swap memory as (total, used, free, sin, sout) namedtuple."""
- if sys.platform.startswith("openbsd"):
+ if OPENBSD:
PAGESIZE = 1
total, used, free, sin, sout = [x * PAGESIZE for x in cext.swap_mem()]
percent = usage_percent(used, total, _round=1)
@@ -305,8 +305,7 @@ def wrap_exceptions(fun):
ZombieProcess is None):
raise
if err.errno == errno.ESRCH:
- # if not pid_exists(self.pid):
- if self.pid not in pids():
+ if not pid_exists(self.pid):
raise NoSuchProcess(self.pid, self._name)
else:
raise ZombieProcess(self.pid, self._name, self._ppid)