From f7f3ff88205b235c4a88e60e0541ff867dd674e9 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Wed, 5 Jul 2023 22:52:41 +0100 Subject: [PATCH] fix FFI definition `Py_EnterRecursiveCall` --- newsfragments/3300.fixed.md | 1 + pyo3-ffi/src/ceval.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 newsfragments/3300.fixed.md diff --git a/newsfragments/3300.fixed.md b/newsfragments/3300.fixed.md new file mode 100644 index 00000000..e7c09ff5 --- /dev/null +++ b/newsfragments/3300.fixed.md @@ -0,0 +1 @@ +Correct FFI definition `Py_EnterRecursiveCall` to return `c_int` (was incorrectly returning `()`). diff --git a/pyo3-ffi/src/ceval.rs b/pyo3-ffi/src/ceval.rs index 1eb59b03..7aae25f8 100644 --- a/pyo3-ffi/src/ceval.rs +++ b/pyo3-ffi/src/ceval.rs @@ -76,7 +76,7 @@ extern "C" { extern "C" { #[cfg(Py_3_9)] #[cfg_attr(PyPy, link_name = "PyPy_EnterRecursiveCall")] - pub fn Py_EnterRecursiveCall(arg1: *const c_char); + pub fn Py_EnterRecursiveCall(arg1: *const c_char) -> c_int; #[cfg(Py_3_9)] #[cfg_attr(PyPy, link_name = "PyPy_LeaveRecursiveCall")] pub fn Py_LeaveRecursiveCall();