From c4967841d696dd7a2458f0d66a77771ec9f7fe83 Mon Sep 17 00:00:00 2001 From: Jah-yee Date: Sat, 14 Mar 2026 01:39:36 +0800 Subject: [PATCH] Fix: sys.exit(1) runs unconditionally due to indentation bug The sys.exit(1) was at the same indentation level as the try block, causing it to run unconditionally after subprocess completes - even when the command succeeds. This fix moves sys.exit(1) inside the except block. Affected files: - setup_env.py (line ~110) - utils/e2e_benchmark.py (line ~23) --- 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")