Add PyType_GetDict for Python 3.12

This commit is contained in:
Marc Mueller 2023-07-23 16:32:02 +02:00
parent 3e4acaa135
commit f8ca456f5f
2 changed files with 4 additions and 0 deletions

View File

@ -0,0 +1 @@
Define `PyType_GetDict()` FFI for CPython 3.12 or later.

View File

@ -349,6 +349,9 @@ pub unsafe fn PyHeapType_GET_MEMBERS(
// skipped _PyType_GetModuleByDef
extern "C" {
#[cfg(Py_3_12)]
pub fn PyType_GetDict(o: *mut PyTypeObject) -> *mut PyObject;
#[cfg_attr(PyPy, link_name = "PyPyObject_Print")]
pub fn PyObject_Print(o: *mut PyObject, fp: *mut ::libc::FILE, flags: c_int) -> c_int;