mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
e59334ebc9
commit
557287075c
10 changed files with 15 additions and 17 deletions
|
@ -938,7 +938,7 @@ local_getattro(localobject *self, PyObject *name)
|
|||
if (r == -1)
|
||||
return NULL;
|
||||
|
||||
if (Py_TYPE(self) != &localtype)
|
||||
if (!Py_IS_TYPE(self, &localtype))
|
||||
/* use generic lookup for subtypes */
|
||||
return _PyObject_GenericGetAttrWithDict(
|
||||
(PyObject *)self, name, ldict, 0);
|
||||
|
@ -1400,7 +1400,7 @@ static PyStructSequence_Desc ExceptHookArgs_desc = {
|
|||
static PyObject *
|
||||
thread_excepthook(PyObject *self, PyObject *args)
|
||||
{
|
||||
if (Py_TYPE(args) != &ExceptHookArgsType) {
|
||||
if (!Py_IS_TYPE(args, &ExceptHookArgsType)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"_thread.excepthook argument type "
|
||||
"must be ExceptHookArgs");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue