Replace obj->ob_type with Py_TYPE(obj).
if (!PyDict_Check(value)) {
PyErr_Format(PyExc_TypeError,
"attrib must be dict, not %.200s",
- value->ob_type->tp_name);
+ Py_TYPE(value)->tp_name);
return -1;
}
if (!self->extra) {
if (!PyLong_Check(result)) {
PyErr_Format(PyExc_TypeError,
"__int__ returned non-int (type %.200s)",
- result->ob_type->tp_name);
+ Py_TYPE(result)->tp_name);
Py_DECREF(result);
return NULL;
}
"__int__ returned non-int (type %.200s). "
"The ability to return an instance of a strict subclass of int "
"is deprecated, and may be removed in a future version of Python.",
- result->ob_type->tp_name)) {
+ Py_TYPE(result)->tp_name)) {
Py_DECREF(result);
return NULL;
}
Py_XDECREF(alias->origin);
Py_XDECREF(alias->args);
Py_XDECREF(alias->parameters);
- self->ob_type->tp_free(self);
+ Py_TYPE(self)->tp_free(self);
}
static int
}
PyErr_Format(PyExc_TypeError,
"argument must be str, not %.50s",
- obj->ob_type->tp_name);
+ Py_TYPE(obj)->tp_name);
return 0;
}
}
PyErr_Format(PyExc_TypeError,
"argument must be str or None, not %.50s",
- obj->ob_type->tp_name);
+ Py_TYPE(obj)->tp_name);
return 0;
}
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;
}
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;
}
{
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;
}
HKEY hkey;
} PyHKEYObject;
-#define PyHKEY_Check(op) ((op)->ob_type == &PyHKEY_Type)
+#define PyHKEY_Check(op) Py_IS_TYPE(op, &PyHKEY_Type)
static char *failMsg = "bad operand type";
PyErr_Format(PyExc_TypeError,
"Objects of type '%s' can not "
"be used as binary registry values",
- value->ob_type->tp_name);
+ Py_TYPE(value)->tp_name);
return FALSE;
}
if the refcount changed.
-typename is object->ob_type->tp_name, extracted from the second PYTHONDUMPREFS
+typename is Py_TYPE(object)->tp_name, extracted from the second PYTHONDUMPREFS
output block.
repr is repr(object), extracted from the first PYTHONDUMPREFS output block.