MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / fetch

Method fetch

src/err.rs:218–226  ·  view source on GitHub ↗

Retrieves the current error from the Python interpreter's global state. The error is cleared from the Python interpreter. If no error is set, returns a `SystemError`.

(py: Python)

Source from the content-addressed store, hash-verified

216 /// The error is cleared from the Python interpreter.
217 /// If no error is set, returns a `SystemError`.
218 pub fn fetch(py: Python) -> PyErr {
219 let mut ptype: *mut ffi::PyObject = ptr::null_mut();
220 let mut pvalue: *mut ffi::PyObject = ptr::null_mut();
221 let mut ptraceback: *mut ffi::PyObject = ptr::null_mut();
222 unsafe {
223 ffi::PyErr_Fetch(&mut ptype, &mut pvalue, &mut ptraceback);
224 PyErr::new_from_ffi_tuple(py, ptype, pvalue, ptraceback)
225 }
226 }
227
228 unsafe fn new_from_ffi_tuple(
229 py: Python,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected