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

Function from_owned_ptr_or_panic

src/err.rs:480–486  ·  view source on GitHub ↗
(py: Python, p: *mut ffi::PyObject)

Source from the content-addressed store, hash-verified

478
479#[inline]
480pub unsafe fn from_owned_ptr_or_panic(py: Python, p: *mut ffi::PyObject) -> PyObject {
481 if p.is_null() {
482 panic_after_error(py);
483 } else {
484 PyObject::from_owned_ptr(py, p)
485 }
486}
487
488pub unsafe fn result_cast_from_owned_ptr<T>(py: Python, p: *mut ffi::PyObject) -> PyResult<T>
489where

Callers 1

py_fn_implFunction · 0.85

Calls 1

panic_after_errorFunction · 0.85

Tested by

no test coverage detected