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:
Andy Lester 2020-03-06 16:53:17 -06:00 committed by GitHub
parent e59334ebc9
commit 557287075c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 17 deletions

View file

@ -573,7 +573,7 @@ keyobject_richcompare(PyObject *ko, PyObject *other, int op)
PyObject *answer;
PyObject* stack[2];
if (Py_TYPE(other) != &keyobject_type){
if (!Py_IS_TYPE(other, &keyobject_type)) {
PyErr_Format(PyExc_TypeError, "other argument must be K instance");
return NULL;
}