From b35a6a58b04c581429c5107ccb6149b7b326a210 Mon Sep 17 00:00:00 2001 From: Nicholas Sim Date: Sat, 13 Feb 2021 17:06:20 +0800 Subject: [PATCH] ffi: methodobject: PyCFunction_Check: fix outdated def --- src/ffi/methodobject.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ffi/methodobject.rs b/src/ffi/methodobject.rs index 66eb52e9..f1aa40bf 100644 --- a/src/ffi/methodobject.rs +++ b/src/ffi/methodobject.rs @@ -1,4 +1,4 @@ -use crate::ffi::object::{PyObject, PyTypeObject, Py_TYPE}; +use crate::ffi::object::{PyObject, PyObject_TypeCheck, PyTypeObject, Py_TYPE}; use std::mem; use std::os::raw::{c_char, c_int}; @@ -16,7 +16,7 @@ pub unsafe fn PyCFunction_CheckExact(op: *mut PyObject) -> c_int { #[inline] pub unsafe fn PyCFunction_Check(op: *mut PyObject) -> c_int { - (Py_TYPE(op) == &mut PyCFunction_Type) as c_int + PyObject_TypeCheck(op, &mut PyCFunction_Type) } pub type PyCFunction =