bpo-40170: Always define PyIter_Check() as a function (GH-24548)

This commit is contained in:
Erlend Egeberg Aasland 2021-02-16 16:05:58 +01:00 committed by GitHub
parent 17dbd4078b
commit cc54001c2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 14 deletions

View file

@ -2732,12 +2732,12 @@ PyObject_GetIter(PyObject *o)
}
}
#undef PyIter_Check
int PyIter_Check(PyObject *obj)
int
PyIter_Check(PyObject *obj)
{
return Py_TYPE(obj)->tp_iternext != NULL &&
Py_TYPE(obj)->tp_iternext != &_PyObject_NextNotImplemented;
PyTypeObject *tp = Py_TYPE(obj);
return (tp->tp_iternext != NULL &&
tp->tp_iternext != &_PyObject_NextNotImplemented);
}
/* Return next item.