From 823cb330b6e0dca40824a086c3615661c771d744 Mon Sep 17 00:00:00 2001 From: easonysliu Date: Fri, 13 Mar 2026 18:31:12 +0800 Subject: [PATCH] fix: move sys.exit(1) inside except block in run_command() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sys.exit(1) was at the same indentation as the try block, so it ran unconditionally after subprocess.run() — even on success. This caused the setup pipeline and benchmarks to always exit with code 1 after the first command without a log_step. Indent it into the except block to match the log_step branch above. --- setup_env.py | 2 +- utils/e2e_benchmark.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_env.py b/setup_env.py index 3bf5fb8f7..4ef7683b8 100644 --- a/setup_env.py +++ b/setup_env.py @@ -104,7 +104,7 @@ def run_command(command, shell=False, log_step=None): subprocess.run(command, shell=shell, check=True) except subprocess.CalledProcessError as e: logging.error(f"Error occurred while running command: {e}") - sys.exit(1) + sys.exit(1) def prepare_model(): _, arch = system_info() diff --git a/utils/e2e_benchmark.py b/utils/e2e_benchmark.py index 07f93ed72..464780bd5 100644 --- a/utils/e2e_benchmark.py +++ b/utils/e2e_benchmark.py @@ -20,7 +20,7 @@ def run_command(command, shell=False, log_step=None): subprocess.run(command, shell=shell, check=True) except subprocess.CalledProcessError as e: logging.error(f"Error occurred while running command: {e}") - sys.exit(1) + sys.exit(1) def run_benchmark(): build_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "build")