Skip to content

Commit 91d3fa4

Browse files
committed
Export the stable ABI PyCFunction_Call shim
Assisted-by: OpenAI Codex:model identifier unavailable
1 parent 3af5f8a commit 91d3fa4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎crates/capi/src/methodobject.rs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ use rustpython_vm::{AsObject, PyObjectRef, PyRef, PyResult, VirtualMachine};
1111
define_py_check!(fn PyCFunction_Check, types.builtin_function_or_method_type);
1212
define_py_check!(exact fn PyCFunction_CheckExact, types.builtin_function_or_method_type);
1313

14+
// Removed from the public API in 3.13, but retained in the stable ABI.
15+
#[unsafe(no_mangle)]
16+
pub unsafe extern "C" fn PyCFunction_Call(
17+
callable: *mut PyObject,
18+
args: *mut PyObject,
19+
kwargs: *mut PyObject,
20+
) -> *mut PyObject {
21+
unsafe { crate::abstract_::PyObject_Call(callable, args, kwargs) }
22+
}
23+
1424
#[repr(C)]
1525
#[derive(Debug)]
1626
pub struct PyMethodDef {

0 commit comments

Comments
 (0)