gh-128078: Clear exception in anext before calling _PyGen_SetStopIterationValue (#128780)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
Bénédikt Tran 2025-01-13 13:55:09 +01:00 committed by GitHub
parent 517dc65ffc
commit 76ffaef729
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 0 deletions

View file

@ -633,6 +633,7 @@ gen_iternext(PyObject *self)
int
_PyGen_SetStopIterationValue(PyObject *value)
{
assert(!PyErr_Occurred());
PyObject *e;
if (value == NULL ||