Skip to content

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

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

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

Conversation

@DavidPCoster

Copy link
Copy Markdown
Collaborator

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

Replace exit() with sys.exit(...) and add a standard-library import sys at the top of src/easyvvuq/sampling/pce.py.

Best minimal fix without changing intended behavior:

  • In the imports section, add import sys.
  • At the error branch around line 174, replace exit() with sys.exit(1) (non-zero status indicates error, matching the existing logging of an unsupported argument type).

This keeps functionality the same (terminate on unsupported type) while removing reliance on site.Quitter.

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