ffi: methodobject: PyModule_Check: update for Py39 change
This commit is contained in:
parent
1c845e7b3b
commit
96fcfe6e0c
|
@ -14,11 +14,18 @@ pub unsafe fn PyCFunction_CheckExact(op: *mut PyObject) -> c_int {
|
|||
(Py_TYPE(op) == &mut PyCFunction_Type) as c_int
|
||||
}
|
||||
|
||||
#[cfg(Py_3_9)]
|
||||
#[inline]
|
||||
pub unsafe fn PyCFunction_Check(op: *mut PyObject) -> c_int {
|
||||
PyObject_TypeCheck(op, &mut PyCFunction_Type)
|
||||
}
|
||||
|
||||
#[cfg(not(Py_3_9))]
|
||||
#[inline]
|
||||
pub unsafe fn PyCFunction_Check(op: *mut PyObject) -> c_int {
|
||||
(Py_TYPE(op) == &mut PyCFunction_Type) as c_int
|
||||
}
|
||||
|
||||
pub type PyCFunction =
|
||||
unsafe extern "C" fn(slf: *mut PyObject, args: *mut PyObject) -> *mut PyObject;
|
||||
|
||||
|
|
Loading…
Reference in a new issue