[3.13] gh-128078: Use PyErr_SetRaisedException in _PyGen_SetStopIterationValue (GH-128287) (#128789)

gh-128078: Use `PyErr_SetRaisedException` in `_PyGen_SetStopIterationValue` (GH-128287)
(cherry picked from commit 402b91da87)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
Miss Islington (bot) 2025-02-04 00:34:02 +01:00 committed by GitHub
parent 186165e509
commit 9120330354
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 23 deletions

View file

@ -1165,7 +1165,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
with self.assertRaises(StopAsyncIteration):
await it.__anext__()
res = await anext(it, ('a', 'b'))
self.assertEqual(res, ('a', 'b'))
self.assertTupleEqual(res, ('a', 'b'))
self.loop.run_until_complete(run())