summaryrefslogtreecommitdiffstats
path: root/Modules/_io
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/_io
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/_io')
-rw-r--r--Modules/_io/_iomodule.c2
-rw-r--r--Modules/_io/textio.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 5932363..d609fa4 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -544,7 +544,7 @@ PyNumber_AsOff_t(PyObject *item, PyObject *err)
/* Otherwise replace the error with caller's error object. */
PyErr_Format(err,
"cannot fit '%.200s' into an offset-sized integer",
- item->ob_type->tp_name);
+ Py_TYPE(item)->tp_name);
}
finish:
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 5ebeb02..c4c56cb 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -1094,7 +1094,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
PyErr_Format(
PyExc_TypeError,
"TextIOWrapper() argument 'errors' must be str or None, not %.50s",
- errors->ob_type->tp_name);
+ Py_TYPE(errors)->tp_name);
return -1;
}
else if (io_check_errors(errors)) {