Skip to content

fix: move sys.exit(1) inside except block in run_command()#448

Open
mango766 wants to merge 1 commit intomicrosoft:mainfrom
mango766:fix/run-command-sysexit-indent
Open

fix: move sys.exit(1) inside except block in run_command()#448
mango766 wants to merge 1 commit intomicrosoft:mainfrom
mango766:fix/run-command-sysexit-indent

Conversation

@mango766
Copy link

Fixes #447

sys.exit(1) was outside the except block due to indentation, so it ran unconditionally after subprocess.run() — even when the command succeeded. This caused the setup pipeline and benchmarks to always exit with code 1 after the first command that runs without a log_step.

The log_step branch (with log file) already has the correct indentation. This just aligns the else branch to match.

Files changed:

  • setup_env.py — line 107
  • utils/e2e_benchmark.py — line 23

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.
@mango766
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sys.exit(1) runs unconditionally due to indentation bug in run_command()

1 participant