diff options
author | Victor Stinner <vstinner@python.org> | 2020-02-07 02:04:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 02:04:21 (GMT) |
commit | 58ac700fb09497df14d4492b6f820109490b2b88 (patch) | |
tree | d6a87b277dd133543974b1b24cf65df4c5c8eff4 /Objects/descrobject.c | |
parent | a102ed7d2f0e7e05438f14d5fb72ca0358602249 (diff) | |
download | cpython-58ac700fb09497df14d4492b6f820109490b2b88.zip cpython-58ac700fb09497df14d4492b6f820109490b2b88.tar.gz cpython-58ac700fb09497df14d4492b6f820109490b2b88.tar.bz2 |
bpo-39573: Use Py_TYPE() macro in Objects directory (GH-18392)
Replace direct access to PyObject.ob_type with Py_TYPE().
Diffstat (limited to 'Objects/descrobject.c')
-rw-r--r-- | Objects/descrobject.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index b9b16d6d..49c26eb 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -84,7 +84,7 @@ descr_check(PyDescrObject *descr, PyObject *obj, PyObject **pres) "doesn't apply to a '%.100s' object", descr_name((PyDescrObject *)descr), "?", descr->d_type->tp_name, - obj->ob_type->tp_name); + Py_TYPE(obj)->tp_name); *pres = NULL; return 1; } @@ -97,7 +97,7 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type) /* Ensure a valid type. Class methods ignore obj. */ if (type == NULL) { if (obj != NULL) - type = (PyObject *)obj->ob_type; + type = (PyObject *)Py_TYPE(obj); else { /* Wot - no type?! */ PyErr_Format(PyExc_TypeError, @@ -114,7 +114,7 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type) "needs a type, not a '%.100s' as arg 2", descr_name((PyDescrObject *)descr), "?", PyDescr_TYPE(descr)->tp_name, - type->ob_type->tp_name); + Py_TYPE(type)->tp_name); return NULL; } if (!PyType_IsSubtype((PyTypeObject *)type, PyDescr_TYPE(descr))) { @@ -194,7 +194,7 @@ descr_setcheck(PyDescrObject *descr, PyObject *obj, PyObject *value, "doesn't apply to a '%.100s' object", descr_name(descr), "?", descr->d_type->tp_name, - obj->ob_type->tp_name); + Py_TYPE(obj)->tp_name); *pres = -1; return 1; } @@ -506,7 +506,7 @@ wrapperdescr_call(PyWrapperDescrObject *descr, PyObject *args, PyObject *kwds) "but received a '%.100s'", descr_name((PyDescrObject *)descr), "?", PyDescr_TYPE(descr)->tp_name, - self->ob_type->tp_name); + Py_TYPE(self)->tp_name); return NULL; } @@ -1234,7 +1234,7 @@ wrapper_repr(wrapperobject *wp) { return PyUnicode_FromFormat("<method-wrapper '%s' of %s object at %p>", wp->descr->d_base->name, - wp->self->ob_type->tp_name, + Py_TYPE(wp->self)->tp_name, wp->self); } @@ -1476,7 +1476,7 @@ property_dealloc(PyObject *self) Py_XDECREF(gs->prop_set); Py_XDECREF(gs->prop_del); Py_XDECREF(gs->prop_doc); - self->ob_type->tp_free(self); + Py_TYPE(self)->tp_free(self); } static PyObject * |