summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/app.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2015-06-19 12:00:06 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2015-06-22 15:52:37 -0300
commitd75e1395c9ff3ffcb0663122140be393c7ae6b60 (patch)
tree00d1251545ab5fad39c913fcc30d6b9467906d51 /src/leap/bitmask/app.py
parent32658ae3108bc67a102cf6e0153d468b3a8ae1b0 (diff)
[feat] support new psutil API
API to get the children has changed on latest psutil, this takes care of it.
Diffstat (limited to 'src/leap/bitmask/app.py')
-rw-r--r--src/leap/bitmask/app.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py
index 543fa03a..aa4e304b 100644
--- a/src/leap/bitmask/app.py
+++ b/src/leap/bitmask/app.py
@@ -73,7 +73,15 @@ def kill_the_children():
parent = psutil.Process(me)
print "Killing all the children processes..."
- for child in parent.get_children(recursive=True):
+ children = None
+ try:
+ # for psutil 0.2.x
+ children = parent.get_children(recursive=True)
+ except:
+ # for psutil 0.3.x
+ children = parent.children(recursive=True)
+
+ for child in children:
try:
child.terminate()
except Exception as exc: