diff options
Diffstat (limited to 'psutil/_pslinux.py')
-rw-r--r-- | psutil/_pslinux.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 110b261f..7a213a71 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1369,15 +1369,11 @@ class Process(object): @wrap_exceptions def status(self): - with open_binary("%s/%s/status" % (self._procfs_path, self.pid)) as f: - for line in f: - if line.startswith(b"State:"): - letter = line.split()[1] - if PY3: - letter = letter.decode() - # XXX is '?' legit? (we're not supposed to return - # it anyway) - return PROC_STATUSES.get(letter, '?') + ret = self._parse_status() + if ret['status'] is None: + raise NotImplementedError("line 'Status' not found in %s" % ( + "%s/%s/status" % (self._procfs_path, self.pid))) + return ret['status'] @wrap_exceptions def open_files(self): |