Tools: autotest: fix process kill in sim_vehicle.py

This commit is contained in:
Rajat Singhal 2019-05-13 18:36:27 +05:30 committed by Peter Barker
parent 7186e443ba
commit ea2ec9e4a2
1 changed files with 3 additions and 2 deletions

View File

@ -196,9 +196,10 @@ def kill_tasks_psutil(victims):
use this routine"""
import psutil
for proc in psutil.process_iter():
if proc.status == psutil.STATUS_ZOMBIE:
pdict = proc.as_dict(attrs=['name', 'status'])
if pdict['status'] == psutil.STATUS_ZOMBIE:
continue
if proc.name in victims:
if pdict['name'] in victims:
proc.kill()