Skip to content

Commit

Permalink
fix send_signal()
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 1, 2023
1 parent 118ff40 commit a6c6d5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,9 @@ def send_signal(self, sig):
self._send_signal(sig)
else: # pragma: no cover
self._raise_if_pid_reused()
if sig != signal.SIGTERM and not self.is_running():
msg = "process no longer exists"
raise NoSuchProcess(self.pid, self._name, msg=msg)
self._proc.send_signal(sig)

def suspend(self):
Expand Down

0 comments on commit a6c6d5a

Please sign in to comment.