From 1a0df71fe856a4cbbf17bf1a1d72b2f36a1dda4f Mon Sep 17 00:00:00 2001 From: John Moon Date: Mon, 28 Nov 2022 13:37:07 -0800 Subject: [PATCH] build: Fix OSError exception When the Bazel subprocess exits unexpectedly, the wrapper script gets an OSError exception while cleaning up the processes. Ignore the OSError exception to make sure all subprocesses are cleaned up properly. Change-Id: I7c1062a900e70cfc2d90bd9695254ba80b07721b Signed-off-by: John Moon --- build_with_bazel.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build_with_bazel.py b/build_with_bazel.py index 6f384f12f7c7..9e3af3edbf98 100755 --- a/build_with_bazel.py +++ b/build_with_bazel.py @@ -36,8 +36,11 @@ class BazelBuilder: def __del__(self): for proc in self.process_list: - proc.kill() - proc.wait() + try: + proc.kill() + proc.wait() + except OSError: + pass @staticmethod def get_cross_cli_opts(toolchain):