Skip to content

Commit

Permalink
processes: bugfix: kill method
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Feb 20, 2022
1 parent 8588de1 commit be3aba3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rpcclient/rpcclient/processes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from rpcclient.exceptions import BadReturnValueError
from rpcclient.structs.consts import SIGTERM


class Processes:
Expand All @@ -9,9 +10,10 @@ def __init__(self, client):
"""
self._client = client

def kill(self, pid: int, sig: int):
def kill(self, pid: int, sig: int = SIGTERM):
""" kill(pid, sig) at remote. read man for more details. """
return self._client.kill(pid, sig)
if 0 != self._client.symbols.kill(pid, sig):
raise BadReturnValueError(f'kill() failed ({self._client.last_error})')

def waitpid(self, pid: int):
""" waitpid(pid, sig) at remote. read man for more details. """
Expand Down

0 comments on commit be3aba3

Please sign in to comment.