bpo-42979: Use _Py_CheckSlotResult() to check slots result #24356
Conversation
04c2696
to
5d020bc
When Python is built in debug mode (with C assertions), calling a type slot like sq_length (__len__() in Python) now fails with a fatal error if the slot succeeded with an exception set, or failed with no exception set. The error message contains the slot, the type name, and the current exception (if an exception is set). * Check the result of all slots using _Py_CheckSlotResult(). * No longer pass op_name to ternary_op() in release mode. * Replace operator with dunder Python method name in error messages. For example, replace "*" with "__mul__". * Fix compiler_exit_scope() when an exception is set. * Fix bytearray.extend() when an exception is set: don't call bytearray_setslice() with an exception set.
Note for myself: I reverted this change, since the operator was part of some TypeError error messages. |
"3 tests failed again: test_gdb test_subprocess test_venv" These errors seem to be unrelated to my PR. |
|
I didn't some basic sanity tests and they completed successfully:
|
a619263
into
python:master
62 of 63 checks passed
62 of 63 checks passed
bedevere/news
News entry found in Misc/NEWS.d
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
When Python is built in debug mode (with C assertions), calling a
type slot like sq_length (len() in Python) now fails with a fatal
error if the slot succeeded with an exception set, or failed with no
exception set.
For example, replace "*" with "mul".
bytearray_setslice() with an exception set.
https://bugs.python.org/issue42979