summaryrefslogtreecommitdiff
path: root/Modules/_ctypes/stgdict.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_ctypes/stgdict.c')
-rw-r--r--Modules/_ctypes/stgdict.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index cfa72ef764..a126eb7ed0 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -83,8 +83,7 @@ StgDict_clone(StgDictObject *dst, StgDictObject *src)
}
PyTypeObject StgDict_Type = {
- PyObject_HEAD_INIT(NULL)
- 0,
+ PyVarObject_HEAD_INIT(NULL, 0)
"StgDict",
sizeof(StgDictObject),
0,
@@ -192,7 +191,7 @@ MakeFields(PyObject *type, CFieldObject *descr,
Py_DECREF(fieldlist);
return -1;
}
- if (fdescr->ob_type != &CField_Type) {
+ if (Py_Type(fdescr) != &CField_Type) {
PyErr_SetString(PyExc_TypeError, "unexpected type");
Py_DECREF(fdescr);
Py_DECREF(fieldlist);
@@ -215,7 +214,7 @@ MakeFields(PyObject *type, CFieldObject *descr,
Py_DECREF(fieldlist);
return -1;
}
- assert(new_descr->ob_type == &CField_Type);
+ assert(Py_Type(new_descr) == &CField_Type);
new_descr->size = fdescr->size;
new_descr->offset = fdescr->offset + offset;
new_descr->index = fdescr->index + index;
@@ -263,7 +262,7 @@ MakeAnonFields(PyObject *type)
Py_DECREF(anon_names);
return -1;
}
- assert(descr->ob_type == &CField_Type);
+ assert(Py_Type(descr) == &CField_Type);
descr->anonymous = 1;
/* descr is in the field descriptor. */