1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-05 18:30:50 +01:00

connection: Un-hardcode _KILL_TIMEOUT

Replace erroneous use of _KILL_TIMEOUT constant by the kill_timeout
parameter.
This commit is contained in:
douglas-raillard-arm 2021-03-23 11:17:39 +00:00 committed by Marc Bonnici
parent 6cabad14d0
commit 4e44863777

View File

@ -221,7 +221,7 @@ class PopenBackgroundCommand(BackgroundCommand):
popen = self.popen
os.killpg(os.getpgid(popen.pid), signal.SIGTERM)
try:
popen.wait(timeout=_KILL_TIMEOUT)
popen.wait(timeout=kill_timeout)
except subprocess.TimeoutExpired:
os.killpg(os.getpgid(popen.pid), signal.SIGKILL)
@ -351,7 +351,7 @@ class AdbBackgroundCommand(BackgroundCommand):
def _cancel(self, kill_timeout):
self.send_signal(signal.SIGTERM)
try:
self.adb_popen.wait(timeout=_KILL_TIMEOUT)
self.adb_popen.wait(timeout=kill_timeout)
except subprocess.TimeoutExpired:
self.send_signal(signal.SIGKILL)
self.adb_popen.kill()