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

Target.killall: catch TargetError on individual kills

killall() is implemented by discovering all PIDs who's name matches the
specified process, and then sending individual kills for each PID. If a
PID no longer exists by the time the kill is sent (e.g. if it was a
child of one of the previously killed PIDs), this will result in a
TargetError, which for the purposes of killall() should be ignored.
This commit is contained in:
Sergei Trofimov 2017-01-30 11:14:36 +00:00
parent 9038339373
commit 6351a3bad9

View File

@ -351,7 +351,10 @@ class Target(object):
def killall(self, process_name, signal=None, as_root=False):
for pid in self.get_pids_of(process_name):
self.kill(pid, signal=signal, as_root=as_root)
try:
self.kill(pid, signal=signal, as_root=as_root)
except TargetError:
pass
def get_pids_of(self, process_name):
raise NotImplementedError()