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

don't use sys.exit in fucntions #28

Closed
jkoelker opened this issue Nov 6, 2011 · 1 comment
Closed

don't use sys.exit in fucntions #28

jkoelker opened this issue Nov 6, 2011 · 1 comment
Assignees
Milestone

Comments

@jkoelker
Copy link
Collaborator

jkoelker commented Nov 6, 2011

sys.exit() should only be called sparingly and usually not with 0.

Functions that need to report a non-zero status, should raise exceptions. The main function should catch these exceptions and translate them into an exit code which main would return.

Then in the if name == 'main' portion it would change to :
exit = main()
if exit:
sys.exit(exit)

@neogenix
Copy link
Owner

neogenix commented Nov 6, 2011

Removed sys.exit(0) with #27.

Still need to refactor 'main' section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants