diff options
author | Victor Stinner <vstinner@python.org> | 2020-07-10 10:40:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 10:40:38 (GMT) |
commit | 8182cc2e68a3c6ea5d5342fed3f1c76b0521fbc1 (patch) | |
tree | 697757da0c635614b16aafc81c3ea1172a634a53 /Objects | |
parent | d878349bac6c154fbfeffe7d4b38e2ddb833f135 (diff) | |
download | cpython-8182cc2e68a3c6ea5d5342fed3f1c76b0521fbc1.zip cpython-8182cc2e68a3c6ea5d5342fed3f1c76b0521fbc1.tar.gz cpython-8182cc2e68a3c6ea5d5342fed3f1c76b0521fbc1.tar.bz2 |
bpo-39573: Use the Py_TYPE() macro (GH-21433)
Replace obj->ob_type with Py_TYPE(obj).
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 4 | ||||
-rw-r--r-- | Objects/genericaliasobject.c | 2 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 3494f33..7bd72c9 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1382,7 +1382,7 @@ PyNumber_Long(PyObject *o) 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; } @@ -1391,7 +1391,7 @@ PyNumber_Long(PyObject *o) "__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; } diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index 4d511a2..87bd1ae 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -20,7 +20,7 @@ ga_dealloc(PyObject *self) 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 diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 809ed85..648dd15 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3325,7 +3325,7 @@ _PyUnicode_WideCharString_Converter(PyObject *obj, void *ptr) } PyErr_Format(PyExc_TypeError, "argument must be str, not %.50s", - obj->ob_type->tp_name); + Py_TYPE(obj)->tp_name); return 0; } @@ -3361,7 +3361,7 @@ _PyUnicode_WideCharString_Opt_Converter(PyObject *obj, void *ptr) } PyErr_Format(PyExc_TypeError, "argument must be str or None, not %.50s", - obj->ob_type->tp_name); + Py_TYPE(obj)->tp_name); return 0; } |