From 91d3fa4b70d4437a6d2ff698402df84cfca8bf6f Mon Sep 17 00:00:00 2001 From: dot Date: Sat, 10 Oct 2026 19:30:47 +0900 Subject: [PATCH] Export the stable ABI PyCFunction_Call shim Assisted-by: OpenAI Codex:model identifier unavailable --- crates/capi/src/methodobject.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/capi/src/methodobject.rs b/crates/capi/src/methodobject.rs index 2e82c5e9daa..3b0795deeb3 100644 --- a/crates/capi/src/methodobject.rs +++ b/crates/capi/src/methodobject.rs @@ -11,6 +11,16 @@ use rustpython_vm::{AsObject, PyObjectRef, PyRef, PyResult, VirtualMachine}; define_py_check!(fn PyCFunction_Check, types.builtin_function_or_method_type); define_py_check!(exact fn PyCFunction_CheckExact, types.builtin_function_or_method_type); +// Removed from the public API in 3.13, but retained in the stable ABI. +#[unsafe(no_mangle)] +pub unsafe extern "C" fn PyCFunction_Call( + callable: *mut PyObject, + args: *mut PyObject, + kwargs: *mut PyObject, +) -> *mut PyObject { + unsafe { crate::abstract_::PyObject_Call(callable, args, kwargs) } +} + #[repr(C)] #[derive(Debug)] pub struct PyMethodDef {