bpo-39573: Use Py_TYPE() macro in Objects directory (GH-18392)
Replace direct access to PyObject.ob_type with Py_TYPE().
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index e716820..343a80c 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -121,7 +121,7 @@
"range expected at least 1 argument, got 0");
return NULL;
default:
- PyErr_Format(PyExc_TypeError,
+ PyErr_Format(PyExc_TypeError,
"range expected at most 3 arguments, got %zd",
num_args);
return NULL;
@@ -631,7 +631,7 @@
}
PyErr_Format(PyExc_TypeError,
"range indices must be integers or slices, not %.200s",
- item->ob_type->tp_name);
+ Py_TYPE(item)->tp_name);
return NULL;
}