This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Dennis Sweeney
Recipients Dennis Sweeney, asvetlov, pewscorner, yselivanov
Date 2021-04-06.19:03:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617735806.04.0.0273592746238.issue43751@roundup.psfhosted.org>
In-reply-to
Content
I can open a PR this evening, but I think this is close to the issue: PyIter_Next() already silences StopIteration, so checking for it afterward fails.

diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index f0c6b79917..95f4659dc9 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -316,7 +316,7 @@ anextawaitable_traverse(anextawaitableobject *obj, visitproc visit, void *arg)
 static PyObject *
 anextawaitable_iternext(anextawaitableobject *obj)
 {
-    PyObject *result = PyIter_Next(obj->wrapped);
+    PyObject *result = (*Py_TYPE(obj->wrapped)->tp_iternext)(obj->wrapped);
     if (result != NULL) {
         return result;
     }
History
Date User Action Args
2021-04-06 19:03:26Dennis Sweeneysetrecipients: + Dennis Sweeney, asvetlov, yselivanov, pewscorner
2021-04-06 19:03:26Dennis Sweeneysetmessageid: <1617735806.04.0.0273592746238.issue43751@roundup.psfhosted.org>
2021-04-06 19:03:26Dennis Sweeneylinkissue43751 messages
2021-04-06 19:03:25Dennis Sweeneycreate