commit | 4de973483e155a3cc51d184218bca399ab5460b0 | [log] [tgz] |
---|---|---|
author | Valentin Schneider <valentin.schneider@arm.com> | Tue Sep 12 14:52:39 2017 +0100 |
committer | Valentin Schneider <valentin.schneider@arm.com> | Tue Sep 12 15:14:23 2017 +0100 |
tree | 499bb78e11c34ca1b82112b62d1513714cdaaa02 | |
parent | 0e9221f58e8d5940babdf4df3bef0ae072c1f014 [diff] |
host: Add kill_children utility method This method is useful for killing the children spawned by Popen() calls with shell=True. For instance: proc = Popen('sleep 100', shell=True) proc.kill() This would spawn a shell task and that shell would spawn the sleep task. Issuing a kill to the Popen handle will only kill the shell task, and the sleep task will keep running. Using host.kill_children(proc.pid) will ensure all child tasks are killed.