Skip to content

Fix exit bugs of multiple python scripts #546

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

Closed
wants to merge 1 commit into from
Closed

Fix exit bugs of multiple python scripts #546

wants to merge 1 commit into from

Conversation

panzarino
Copy link
Contributor

Make sure that the system uses sys.exit(1) rather than just exit(1) because exit(1) should not be used in production.

exit() should not be used in production code. This is because it only works if the site module is loaded. Instead, this function should only be used in the interpreter.

Unlike exit() or quit() however, sys.exit is considered good to use in production code. This is because the sys module will always be there.

@panzarino panzarino changed the title Proper exiting of a program Proper exiting of a python script Dec 15, 2015
@jrose-apple
Copy link
Contributor

I'm trying to remember why I wrote fail.py rather than just hardcoding /usr/bin/false.

The proper way to exit a python script is to use sys.exit not just exit
@panzarino
Copy link
Contributor Author

I just added some more python scripts that had the same problem

@gparker42
Copy link
Contributor

#540 also fixes some of these.

@panzarino panzarino changed the title Proper exiting of a python script Fix exit bugs of multiple python scripts Dec 15, 2015
@panzarino
Copy link
Contributor Author

Replaced by #903

@panzarino panzarino closed this Jan 7, 2016
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
…er-on-error

[Stress Tester XFails] Add new XFails found by continuing the stress tester on error
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.

3 participants