From d4becc3f156bdc7565a64061f1c5711eb9f6791a Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Thu, 12 Nov 2015 06:09:28 +0100 Subject: last fixes --- psutil/_psbsd.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'psutil/_psbsd.py') 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) -- cgit v1.2.1