summaryrefslogtreecommitdiffstats
path: root/Modules/_csv.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-07 02:37:06 (GMT)
committerGitHub <noreply@github.com>2020-02-07 02:37:06 (GMT)
commitdaa9756cb6395323d6f291efe5c7d7fdc6b2e9d8 (patch)
tree363abf13e467be17feb0e3eeffc3abe73c437264 /Modules/_csv.c
parent58ac700fb09497df14d4492b6f820109490b2b88 (diff)
downloadcpython-daa9756cb6395323d6f291efe5c7d7fdc6b2e9d8.zip
cpython-daa9756cb6395323d6f291efe5c7d7fdc6b2e9d8.tar.gz
cpython-daa9756cb6395323d6f291efe5c7d7fdc6b2e9d8.tar.bz2
bpo-39573: Use Py_TYPE() macro in Modules directory (GH-18393)
Replace direct access to PyObject.ob_type with Py_TYPE().
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r--Modules/_csv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c
index aaf3776..2d541bb 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -236,7 +236,7 @@ _set_char(const char *name, Py_UCS4 *target, PyObject *src, Py_UCS4 dflt)
if (!PyUnicode_Check(src)) {
PyErr_Format(PyExc_TypeError,
"\"%s\" must be string, not %.200s", name,
- src->ob_type->tp_name);
+ Py_TYPE(src)->tp_name);
return -1;
}
len = PyUnicode_GetLength(src);
@@ -807,7 +807,7 @@ Reader_iternext(ReaderObj *self)
"iterator should return strings, "
"not %.200s "
"(did you open the file in text mode?)",
- lineobj->ob_type->tp_name
+ Py_TYPE(lineobj)->tp_name
);
Py_DECREF(lineobj);
return NULL;
@@ -1168,7 +1168,7 @@ csv_writerow(WriterObj *self, PyObject *seq)
if (iter == NULL)
return PyErr_Format(_csvstate_global->error_obj,
"iterable expected, not %.200s",
- seq->ob_type->tp_name);
+ Py_TYPE(seq)->tp_name);
/* Join all fields in internal buffer.
*/