Skip to content

Fix for Use of exit() or quit()#20

Open
odaysec wants to merge 1 commit into
Roblox:mainfrom
odaysec:patch-1
Open

Fix for Use of exit() or quit()#20
odaysec wants to merge 1 commit into
Roblox:mainfrom
odaysec:patch-1

Conversation

@odaysec

@odaysec odaysec commented Jun 19, 2026

Copy link
Copy Markdown

The exit and quit "functions" are actually site.Quitter objects and are loaded, at interpreter start up, from site. However, if the interpreter is started with the -S flag, or a custom site is used then exit and quit may not be present. In this exit() is used and will fail if the interpreter is passed the -S option.

Use sys.exit(1) instead of exit(1) in this script. sys.exit is always available after importing sys (already imported at line 17), and is the correct non-interactive termination API. Best fix in this snippet: update the three shown occurrences in argument parsing error branches (lines 63, 72, and 81) from exit(1) to sys.exit(1).

Checklist before submitting:

  • Added/updated relevant tests
  • Added/updated documentation

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