Adjust test suite for new psutil versions
psutil 2.x and above has a lot of API changes as described in: https://github.com/giampaolo/psutil/blob/master/HISTORY.rst So we should work correctly with both old and new psutil versions by using a version check and use the correct method/attributes. This allows to eventually unlift the version cap that starts to hurt. Change-Id: I6b6682e3af34f43da4e397d602e9ee4e1c83970f Related-Bug: 1645918
This commit is contained in:
parent
e403a6bad0
commit
e1e0ef0916
|
@ -60,7 +60,12 @@ PHASES = ['pre-configure',
|
|||
|
||||
def timeout():
|
||||
p = psutil.Process()
|
||||
children = list(p.get_children(recursive=True))
|
||||
try:
|
||||
# psutils version >= 2
|
||||
children = list(p.children(recursive=True))
|
||||
except AttributeError:
|
||||
children = list(p.get_children(recursive=True))
|
||||
|
||||
for child in children:
|
||||
child.kill()
|
||||
|
||||
|
|
Loading…
Reference in New Issue