diff --git a/pyo3-ffi/src/pyframe.rs b/pyo3-ffi/src/pyframe.rs index c58bc1fbc2d..43a9d1f6777 100644 --- a/pyo3-ffi/src/pyframe.rs +++ b/pyo3-ffi/src/pyframe.rs @@ -1,3 +1,5 @@ +#[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))] +use crate::PyCodeObject; #[cfg(not(Py_LIMITED_API))] use crate::PyFrameObject; use std::os::raw::c_int; @@ -7,5 +9,6 @@ opaque_struct!(PyFrameObject); extern "C" { pub fn PyFrame_GetLineNumber(f: *mut PyFrameObject) -> c_int; + #[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))] + pub fn PyFrame_GetCode(f: *mut PyFrameObject) -> *mut PyCodeObject; } -// skipped PyFrame_GetCode