diff --git a/src/local_ops.py b/src/local_ops.py index a55270b..499eb6d 100644 --- a/src/local_ops.py +++ b/src/local_ops.py @@ -568,10 +568,11 @@ def remove_file(self, filename): return os.remove(filename) # Processes control - def kill(self, pid, signal, expect_error=False): + def kill(self, pid: int, signal: int): # Kill the process - cmd = "kill -{} {}".format(signal, pid) - return self.exec_command(cmd, expect_error=expect_error) + assert type(pid) == int # noqa: E721 + assert type(signal) == int # noqa: E721 + os.kill(pid, signal) def get_pid(self): # Get current process id diff --git a/src/os_ops.py b/src/os_ops.py index 4642226..f43f8c7 100644 --- a/src/os_ops.py +++ b/src/os_ops.py @@ -126,8 +126,10 @@ def remove_file(self, filename): raise NotImplementedError() # Processes control - def kill(self, pid, signal): + def kill(self, pid: int, signal: int): # Kill the process + assert type(pid) == int # noqa: E721 + assert type(signal) == int # noqa: E721 raise NotImplementedError() def get_pid(self): diff --git a/src/remote_ops.py b/src/remote_ops.py index 7fcc642..42eede9 100644 --- a/src/remote_ops.py +++ b/src/remote_ops.py @@ -658,8 +658,10 @@ def remove_file(self, filename): return self.exec_command(cmd) # Processes control - def kill(self, pid, signal): + def kill(self, pid: int, signal: int): # Kill the process + assert type(pid) == int # noqa: E721 + assert type(signal) == int # noqa: E721 cmd = "kill -{} {}".format(signal, pid) return self.exec_command(cmd)