Skip to content

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

Open
TheGittyPerson wants to merge 4 commits intoPetter12131451:mainfrom
TheGittyPerson:fix-program-exit
Open

Use sys.exit() instead of exit()#1
TheGittyPerson wants to merge 4 commits intoPetter12131451:mainfrom
TheGittyPerson:fix-program-exit

Conversation

@TheGittyPerson
Copy link
Copy Markdown

Hello! I found a slight issue in your program, but could not find the "Issues" tab you were referring to in your README.md (perhaps you forgot to set up one), so I just did a normal fork and pull request here.

Issue I fixed

Originally, your program used exit() to exit the program, but this function is specifically designed for the interactive Python shell (REPL), which I don't think is what you intend for users to run your program in. When I run the program in IDLE, for example, the shell window opens a pop-up that says "Your program is still running! Do you want to kill it?", and closes the shell window completely after pressing "OK". I assume this isn't the expected behaviour.

I have changed the exit() calls in your code to sys.exit(), which is a more suitable way to exit the program.


Please review the changes I made, and please do ask questions or request clarification!

@Petter12131451 Petter12131451 force-pushed the main branch 28 times, most recently from cd0d324 to b678ed1 Compare February 24, 2026 01:43
@Petter12131451 Petter12131451 force-pushed the main branch 19 times, most recently from 852709e to 32db7cb Compare February 28, 2026 02:31
@Petter12131451 Petter12131451 force-pushed the main branch 8 times, most recently from efe13ae to 71bdd55 Compare March 1, 2026 04:55
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.

2 participants