aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Balana <sbalana@google.com>2024-01-31 15:26:48 -0800
committerGitHub <noreply@github.com>2024-01-31 15:26:48 -0800
commit13537bce9b146e3c44fc8117f5cf23a106bfdd4b (patch)
tree5bdd53115a8e1f03b4742e5f26d8165903f9fce0
parent7b938e0579ce4bf5f183b19bab8d7273674752b5 (diff)
downloadmobly-13537bce9b146e3c44fc8117f5cf23a106bfdd4b.tar.gz
Fix whitespace stripping in _collect_process_tree (#891)
Fix UtilsTest.test_stop_standing_subproc_and_descendants failure for versions of ps that do not include a space after each newline. Co-authored-by: Ang Li <angli@google.com>
-rw-r--r--mobly/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mobly/utils.py b/mobly/utils.py
index 64dc3f1..4d5dfc6 100644
--- a/mobly/utils.py
+++ b/mobly/utils.py
@@ -290,7 +290,7 @@ def _collect_process_tree(starting_pid):
# Ignore if there is not child process.
continue
- children_pid_list = list(map(int, ps_results.split('\n ')))
+ children_pid_list = [int(p.strip()) for p in ps_results.split('\n')]
stack.extend(children_pid_list)
ret.extend(children_pid_list)