diff --git a/newsfragments/2788.added.md b/newsfragments/2788.added.md new file mode 100644 index 00000000000..2c744cef929 --- /dev/null +++ b/newsfragments/2788.added.md @@ -0,0 +1 @@ +Define `_PyErr_ChainExceptions()` FFI for CPython. diff --git a/pyo3-ffi/src/cpython/pyerrors.rs b/pyo3-ffi/src/cpython/pyerrors.rs index afc5ae93746..abbffc0b8c2 100644 --- a/pyo3-ffi/src/cpython/pyerrors.rs +++ b/pyo3-ffi/src/cpython/pyerrors.rs @@ -150,6 +150,11 @@ pub struct PyStopIterationObject { pub value: *mut PyObject, } +extern "C" { + #[cfg(not(PyPy))] + pub fn _PyErr_ChainExceptions(typ: *mut PyObject, val: *mut PyObject, tb: *mut PyObject); +} + // skipped PyNameErrorObject // skipped PyAttributeErrorObject @@ -160,8 +165,6 @@ pub struct PyStopIterationObject { // skipped _PyErr_GetTopmostException // skipped _PyErr_GetExcInfo -// skipped _PyErr_ChainExceptions - // skipped PyErr_SetFromErrnoWithUnicodeFilename // skipped _PyErr_FormatFromCause