diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-02-16 15:05:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 15:05:58 (GMT) |
commit | cc54001c2eb3b14320c1667b22602d69c90d5865 (patch) | |
tree | 1c4b39bfc9027e42b3f18c0cae147a8d0f7115e4 /Objects | |
parent | 17dbd4078b68db8954df6b5cdc40b786bc4ad7af (diff) | |
download | cpython-cc54001c2eb3b14320c1667b22602d69c90d5865.zip cpython-cc54001c2eb3b14320c1667b22602d69c90d5865.tar.gz cpython-cc54001c2eb3b14320c1667b22602d69c90d5865.tar.bz2 |
bpo-40170: Always define PyIter_Check() as a function (GH-24548)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 74a73ee..c93309b 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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. |