diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-05-04 13:31:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 13:31:38 (GMT) |
commit | 5e8ffe147710e449c2e935a4e2ff5cbd19828a8a (patch) | |
tree | 4faa5ee8ccbae4dc255e0a2d912b6e64602b0538 /Objects/genericaliasobject.c | |
parent | 846d8b28ab9bb6197ee81372820311c0abe509c0 (diff) | |
download | cpython-5e8ffe147710e449c2e935a4e2ff5cbd19828a8a.zip cpython-5e8ffe147710e449c2e935a4e2ff5cbd19828a8a.tar.gz cpython-5e8ffe147710e449c2e935a4e2ff5cbd19828a8a.tar.bz2 |
bpo-39573: Use Py_IS_TYPE to check for types (GH-19882)
Diffstat (limited to 'Objects/genericaliasobject.c')
-rw-r--r-- | Objects/genericaliasobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index c06d79c..4d511a2 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -424,8 +424,8 @@ ga_getattro(PyObject *self, PyObject *name) static PyObject * ga_richcompare(PyObject *a, PyObject *b, int op) { - if (Py_TYPE(a) != &Py_GenericAliasType || - Py_TYPE(b) != &Py_GenericAliasType || + if (!Py_IS_TYPE(a, &Py_GenericAliasType) || + !Py_IS_TYPE(b, &Py_GenericAliasType) || (op != Py_EQ && op != Py_NE)) { Py_RETURN_NOTIMPLEMENTED; |