Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use distinct exit codes for intentional exits #521

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pykereaper
Copy link

Currently, all the intentional application exits look like this:

exit("Please give an email address.")

This causes all exit codes to be 1. That's the same exit code when an Error is raised. This means, it is impossible to distinguish programmatically, if the application crashed, or halted gracefully. That can be important, when this application is called e. g. from within a script.

This pull request fixes this issue, by splitting all exit(<string>) occurrences in a print(<string>) call, followed by a exit() with a suitable code from the os package. For example:

print("Please give an email address.")
exit(os.EX_IOERR)

I would highly appreciate, if this pull request would be merged. I can't imagine a scenario, where this change has any negative effect.

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