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
Few changes in sys.breakpointhook() #78937
Comments
The proposed PR makes the following changes in sys.breakpointhook():
sys.breakpointhook() was added in bpo-31353. |
Hi Serhiy. I'm curious whether this is a pure clean up or if there are actual problems you're trying to fix.
|
This is a pure clean up except the last item which fixes a minor problem. I had wrote this patch a while ago (perhaps before 3.7.0 was released), and now revive my old patches. I think that the general rule is that exceptions shouldn't be ignored blindly, except in case when we have no choice (like in destructors). ImportError and AttributeError are expected exceptions raised in PyImport_ImportModuleLevelObject and PyObject_GetAttrString when PYTHONBREAKPOINT points to non-existing name, all other exceptions mean exceptional situation or programming error. Note that exceptions raised when call the hook are not ignored. |
I will drop cleanup changes if they don't look good to you. |
The part of the clean up was applied in PR 9519. And since _PyObject_GetBuiltin() was gone, the rest of the clean up no longer applicable. The only part that is left is to make unexpected exceptions no longer silenced. |
I reopen the issue. This change broke test_builtin: see bpo-35742. I can reproduce the test failure on my Fedoea 29 using: ./python -m test -v test_builtin -m TestBreakpoint |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: