Skip to content

Potential fix for code scanning alert no. 295: Use of exit() or quit() - #494

Draft
DavidPCoster wants to merge 1 commit into
devfrom
alert-autofix-295
Draft

Potential fix for code scanning alert no. 295: Use of exit() or quit()#494
DavidPCoster wants to merge 1 commit into
devfrom
alert-autofix-295

Conversation

@DavidPCoster

Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/UCL-CCS/EasyVVUQ/security/code-scanning/295

Use sys.exit() instead of exit().

Best fix in this file:

  1. Add import sys near the existing imports at the top of src/easyvvuq/sampling/pce.py.
  2. Replace the exit() call in the unexpected transformation branch with sys.exit(1) (non-zero code indicates abnormal termination and preserves intended behavior of aborting execution).

This keeps functionality the same (terminate on critical impossible state) while ensuring the symbol always exists.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

1 participant