-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Replace exit
with `sys.exit
#21052
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
Replace exit
with `sys.exit
#21052
Conversation
We also seem to have a few
fyi: @SkafteNicki |
@bhimrazy good call, fixed now :] |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21052 +/- ##
=======================================
Coverage 87% 87%
=======================================
Files 268 268
Lines 23321 23324 +3
=======================================
+ Hits 20313 20316 +3
Misses 3008 3008 |
What does this PR do?
Fixes #20666
Fixes #20317
exit()
andquit()
are only guaranteed to be available in interactive envs, where the site module injects them. Thus, user are sometimes experiencing that they are missing (particular in jupyter notebook/lab). Also from the Python docs they are discourage to be used in production code:https://docs.python.org/3/library/constants.html#constants-added-by-the-site-module
Use
sys.exit
instead which should always be available.Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--21052.org.readthedocs.build/en/21052/