Skip to content

Commit 928c049

Browse files
committed
use GetFlags
1 parent 45bc565 commit 928c049

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/C/extras.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Py_TypeCheck(o, t) = Base.GC.@preserve o t PyType_IsSubtype(Py_Type(asptr(o)), a
88
Py_TypeCheckFast(o, f::Integer) = Base.GC.@preserve o PyType_IsSubtypeFast(Py_Type(asptr(o)), f)
99

1010
PyType_IsSubtypeFast(t, f::Integer) =
11-
Base.GC.@preserve t Cint(!iszero(UnsafePtr{PyTypeObject}(asptr(t)).flags[] & f))
11+
Base.GC.@preserve t Cint(!iszero(PyType_GetFlags(asptr(t)) & f))
1212

1313
PyMemoryView_GET_BUFFER(m) = Base.GC.@preserve m Ptr{Py_buffer}(UnsafePtr{PyMemoryViewObject}(asptr(m)).view)
1414

src/C/pointers.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ const CAPI_FUNC_SIGS = Dict{Symbol,Pair{Tuple,Type}}(
8080
:PyType_FromSpec => (Ptr{PyType_Spec},) => PyPtr,
8181
:PyType_FromSpecWithBases => (Ptr{PyType_Spec}, PyPtr) => PyPtr,
8282
:PyType_GetSlot => (PyPtr, Cint) => Ptr{Cvoid},
83+
:PyType_GetFlags => (PyPtr,) => Culong,
84+
# TODO: PyType_GetName, once we are Python 3.11+ exclusively
8385
# MAPPING
8486
:PyMapping_HasKeyString => (PyPtr, Ptr{Cchar}) => Cint,
8587
:PyMapping_SetItemString => (PyPtr, Ptr{Cchar}, PyPtr) => Cint,

0 commit comments

Comments
 (0)