Skip to content

Commit

Permalink
[process] Correct exception usage
Browse files Browse the repository at this point in the history
Corrects exception handling from `psutil._exceptions.NoSuchProcess` to
`psutil.NoSuchProcess`.

Signed-off-by: Jake Hunsaker <[email protected]>
  • Loading branch information
TurboTurtle committed Apr 20, 2022
1 parent 0979540 commit 3c3ddfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rigging/rigs/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def watch_process_for_status(self, process, status, invert):
% (process, _stat, status))
return True
self.wait_loop()
except psutil._exceptions.NoSuchProcess:
except psutil.NoSuchProcess:
if status == '!running':
self.log_info("Process %s is no longer running, matching "
"trigger state '%s'" % (process, status))
Expand Down Expand Up @@ -280,7 +280,7 @@ def watch_process_for_mem(self, process, limit, mem_type):
% (process, mem_type, _check, limit))
return True
self.wait_loop()
except psutil._exceptions.NoSuchProcess:
except psutil.NoSuchProcess:
self.log_info("Process %s is no longer running." % process)
return self._hold_thread(process, "%s consumption" % mem_type)

Expand Down Expand Up @@ -309,6 +309,6 @@ def watch_process_for_perc(self, process, limit, resource):
% (process, resource, _perc, limit))
return True
self.wait_loop()
except psutil._exceptions.NoSuchProcess:
except psutil.NoSuchProcess:
self.log_info("Process %s is no longer running." % process)
return self._hold_thread(process, resource)

0 comments on commit 3c3ddfd

Please sign in to comment.