Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/local_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/os_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion src/remote_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down