Skip to content

Commit

Permalink
BSD cmdline()
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Dec 21, 2024
1 parent 69d3252 commit e91c404
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions psutil/_psbsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,12 @@ def cmdline(self):
return cext.proc_cmdline(self.pid)
except OSError as err:
if err.errno == errno.EINVAL:
# fmt: off
if is_zombie(self.pid):
raise ZombieProcess(self.pid, self._name, self._ppid)
raise ZombieProcess(self.pid, self._name, self._ppid) from err # noqa: E501
elif not pid_exists(self.pid):
raise NoSuchProcess(self.pid, self._name, self._ppid)
raise NoSuchProcess(self.pid, self._name, self._ppid) from err # noqa: E501
# fmt: on
else:
# XXX: this happens with unicode tests. It means the C
# routine is unable to decode invalid unicode chars.
Expand Down

0 comments on commit e91c404

Please sign in to comment.