mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
bpo-42979: Enhance abstract.c assertions checking slot result (GH-24352)
* bpo-42979: Enhance abstract.c assertions checking slot result Add _Py_CheckSlotResult() function which fails with a fatal error if a slot function succeeded with an exception set or failed with no exception set: write the slot name, the type name and the current exception (if an exception is set).
This commit is contained in:
parent
eeb701adc0
commit
c9b8e9c421
6 changed files with 126 additions and 51 deletions
|
|
@ -168,6 +168,12 @@ _PyObject_IS_GC(PyObject *obj)
|
|||
// Fast inlined version of PyType_IS_GC()
|
||||
#define _PyType_IS_GC(t) _PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
|
||||
|
||||
// Usage: assert(_Py_CheckSlotResult(obj, "__getitem__", result != NULL)));
|
||||
extern int _Py_CheckSlotResult(
|
||||
PyObject *obj,
|
||||
const char *slot_name,
|
||||
int success);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue