From 9aa037e69aec3aaf1ea2defc8fd5a7ff9030905a Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Tue, 17 May 2016 19:23:22 +0000 Subject: [PATCH] Fix in psutil. Versions prior to 2.0.0 used different way to access information on processes --- python/trisurf/trisurf.py | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python/trisurf/trisurf.py b/python/trisurf/trisurf.py index ac8abaf..ce23b5f 100644 --- a/python/trisurf/trisurf.py +++ b/python/trisurf/trisurf.py @@ -325,8 +325,14 @@ if(psutil.pid_exists(int(pid))): proc= psutil.Process(int(pid)) #psutil.__version__ == '3.4.2' requires name() and status(), some older versions reguire name, status - if proc.name()=="trisurf": - if proc.status()=="stopped": + if(psutil.__version__>='2.0.0'): + procname=proc.name() + procstat=proc.status() + else: + procname=proc.name + procstat=proc.status + if procname=="trisurf": + if procstat=="stopped": return TS_STOPPED else: return TS_RUNNING -- Gitblit v1.9.3