diff options
author | Victor Stinner <vstinner@python.org> | 2020-02-07 01:24:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 01:24:48 (GMT) |
commit | a102ed7d2f0e7e05438f14d5fb72ca0358602249 (patch) | |
tree | a5a3aca7a251c82d7b35c130cc913d6009baa18a /Python/getargs.c | |
parent | 38aaaaac805fa30870e2d093e52a900dddde3b34 (diff) | |
download | cpython-a102ed7d2f0e7e05438f14d5fb72ca0358602249.zip cpython-a102ed7d2f0e7e05438f14d5fb72ca0358602249.tar.gz cpython-a102ed7d2f0e7e05438f14d5fb72ca0358602249.tar.bz2 |
bpo-39573: Use Py_TYPE() macro in Python and Include directories (GH-18391)
Replace direct access to PyObject.ob_type with Py_TYPE().
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index d5caf47..d644aea 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -531,7 +531,7 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags, toplevel ? "expected %d arguments, not %.50s" : "must be %d-item sequence, not %.50s", n, - arg == Py_None ? "None" : arg->ob_type->tp_name); + arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); return msgbuf; } @@ -621,7 +621,7 @@ _PyArg_BadArgument(const char *fname, const char *displayname, PyErr_Format(PyExc_TypeError, "%.200s() %.200s must be %.50s, not %.50s", fname, displayname, expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); + arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); } static const char * @@ -636,7 +636,7 @@ converterr(const char *expected, PyObject *arg, char *msgbuf, size_t bufsize) else { PyOS_snprintf(msgbuf, bufsize, "must be %.50s, not %.50s", expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); + arg == Py_None ? "None" : Py_TYPE(arg)->tp_name); } return msgbuf; } @@ -1331,7 +1331,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, type = va_arg(*p_va, PyTypeObject*); p = va_arg(*p_va, PyObject **); format++; - if (PyType_IsSubtype(arg->ob_type, type)) + if (PyType_IsSubtype(Py_TYPE(arg), type)) *p = arg; else return converterr(type->tp_name, arg, msgbuf, bufsize); |