Define _PyErr_ChainExceptions() FFI for CPython
This appears to be the only way to chain exceptions via the FFI. It was introduced prior to CPython 3.7. It has some description of usage in PEP 490. There was a discussion of whether it should be made stable in BPO 44938.
This commit is contained in:
parent
a67c5782e8
commit
d5a31706c6
1
newsfragments/2788.added.md
Normal file
1
newsfragments/2788.added.md
Normal file
|
@ -0,0 +1 @@
|
|||
Define `_PyErr_ChainExceptions()` FFI for CPython.
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue