summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-07 02:04:21 (GMT)
committerGitHub <noreply@github.com>2020-02-07 02:04:21 (GMT)
commit58ac700fb09497df14d4492b6f820109490b2b88 (patch)
treed6a87b277dd133543974b1b24cf65df4c5c8eff4 /Objects/longobject.c
parenta102ed7d2f0e7e05438f14d5fb72ca0358602249 (diff)
downloadcpython-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/longobject.c')
-rw-r--r--Objects/longobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 9115fa1..67cbc7b 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -150,7 +150,7 @@ _PyLong_FromNbInt(PyObject *integral)
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;
}
@@ -159,7 +159,7 @@ _PyLong_FromNbInt(PyObject *integral)
"__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;
}
@@ -203,7 +203,7 @@ _PyLong_FromNbIndexOrNbInt(PyObject *integral)
if (!PyLong_Check(result)) {
PyErr_Format(PyExc_TypeError,
"__index__ returned non-int (type %.200s)",
- result->ob_type->tp_name);
+ Py_TYPE(result)->tp_name);
Py_DECREF(result);
return NULL;
}
@@ -212,7 +212,7 @@ _PyLong_FromNbIndexOrNbInt(PyObject *integral)
"__index__ 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;