Skip to main content

trampoline_unraisable

Function trampoline_unraisable 

Source
unsafe fn trampoline_unraisable<F>(body: F, ctx: *mut PyObject)
where F: for<'py> FnOnce(Python<'py>) -> PyResult<()> + UnwindSafe,
Expand description

Implementation of trampoline for functions which can’t return an error.

Panics during execution are trapped so that they don’t propagate through any outer FFI boundary.

Exceptions produced are sent to sys.unraisablehook.

§Safety

  • ctx must be either a valid ffi::PyObject or NULL
  • The thread must be attached to the interpreter when this is called.
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here