Skip to content

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

@mango766

Description

@mango766

Hi!

I think there's an indentation issue in setup_env.py (line 107) inside the run_command function:

    else:
        try:
            subprocess.run(command, shell=shell, check=True)
        except subprocess.CalledProcessError as e:
            logging.error(f"Error occurred while running command: {e}")
        sys.exit(1)  # this is outside the except block

The sys.exit(1) is at the same indentation as the try, so it runs unconditionally after the subprocess finishes — even when the command succeeds. I believe it was meant to be inside the except block.

The same pattern is in utils/e2e_benchmark.py line 23.

Happy to send a PR to fix the indentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions