bpo-39573: Use the Py_TYPE() macro (GH-21433)
Replace obj->ob_type with Py_TYPE(obj).
diff --git a/PC/_msi.c b/PC/_msi.c
index f725c81..504899d 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -193,7 +193,7 @@
if (!PyBytes_Check(result)) {
PyErr_Format(PyExc_TypeError,
"Incorrect return type %s from getnextcabinet",
- result->ob_type->tp_name);
+ Py_TYPE(result)->tp_name);
Py_DECREF(result);
return FALSE;
}
@@ -879,7 +879,7 @@
MSIHANDLE params = 0;
if (oparams != Py_None) {
- if (oparams->ob_type != &record_Type) {
+ if (!Py_IS_TYPE(oparams, &record_Type)) {
PyErr_SetString(PyExc_TypeError, "Execute argument must be a record");
return NULL;
}
@@ -955,7 +955,7 @@
{
int status;
- if (data->ob_type != &record_Type) {
+ if (!Py_IS_TYPE(data, &record_Type)) {
PyErr_SetString(PyExc_TypeError, "Modify expects a record object");
return NULL;
}