summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs
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/cjkcodecs
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/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/multibytecodec.c2
-rw-r--r--Modules/cjkcodecs/multibytecodec.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index f24ec93..2dd63a9 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -1450,7 +1450,7 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
PyErr_Format(PyExc_TypeError,
"stream function returned a "
"non-bytes object (%.100s)",
- cres->ob_type->tp_name);
+ Py_TYPE(cres)->tp_name);
goto errorexit;
}
diff --git a/Modules/cjkcodecs/multibytecodec.h b/Modules/cjkcodecs/multibytecodec.h
index 6d34534..94670ec 100644
--- a/Modules/cjkcodecs/multibytecodec.h
+++ b/Modules/cjkcodecs/multibytecodec.h
@@ -65,7 +65,7 @@ typedef struct {
MultibyteCodec *codec;
} MultibyteCodecObject;
-#define MultibyteCodec_Check(op) ((op)->ob_type == &MultibyteCodec_Type)
+#define MultibyteCodec_Check(op) (Py_TYPE(op) == &MultibyteCodec_Type)
#define _MultibyteStatefulCodec_HEAD \
PyObject_HEAD \