@@ -2041,7 +2041,6 @@ PyCSimpleType_init(PyObject *self, PyObject *args, PyObject *kwds)
2041
2041
/* create the new instance (which is a class,
2042
2042
since we are a metatype!) */
2043
2043
result = (PyTypeObject * )self ; // by PyType_Type.tp_new()
2044
- PyTypeObject * type = Py_TYPE (self );
2045
2044
2046
2045
ctypes_state * st = GLOBAL_STATE ();
2047
2046
@@ -2169,6 +2168,7 @@ PyCSimpleType_init(PyObject *self, PyObject *args, PyObject *kwds)
2169
2168
}
2170
2169
}
2171
2170
2171
+ PyTypeObject * type = Py_TYPE (self );
2172
2172
if (type == & PyCSimpleType_Type && fmt -> setfunc_swapped && fmt -> getfunc_swapped ) {
2173
2173
PyObject * swapped = CreateSwappedType (type , args , kwds ,
2174
2174
proto , fmt );
@@ -3035,6 +3035,7 @@ int _ctypes_simple_instance(PyObject *obj)
3035
3035
{
3036
3036
PyTypeObject * type = (PyTypeObject * )obj ;
3037
3037
ctypes_state * st = GLOBAL_STATE ();
3038
+
3038
3039
if (PyCSimpleTypeObject_Check (type )) {
3039
3040
return type -> tp_base != st -> Simple_Type ;
3040
3041
}
@@ -5702,7 +5703,7 @@ _ctypes_add_types(PyObject *mod)
5702
5703
MOD_ADD_TYPE (& PyCPointer_Type , & PyCPointerType_Type , & PyCData_Type );
5703
5704
MOD_ADD_TYPE (& PyCArray_Type , & PyCArrayType_Type , & PyCData_Type );
5704
5705
MOD_ADD_HEAPTYPE (st -> Simple_Type , & simple_spec , & PyCData_Type ,
5705
- & PyCSimpleType_Type );
5706
+ & PyCSimpleType_Type );
5706
5707
MOD_ADD_TYPE (& PyCFuncPtr_Type , & PyCFuncPtrType_Type , & PyCData_Type );
5707
5708
5708
5709
/*************************************************
0 commit comments