Skip to content

Commit

Permalink
gh-125038: Test on gi_frame.f_locals change for a generator
Browse files Browse the repository at this point in the history
  • Loading branch information
efimov-mikhail committed Oct 7, 2024
1 parent ffc0958 commit 4f52d20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Lib/test/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ def loop():
#This should not raise
loop()

def test_issue125038(self):
g = (x for x in range(10))
g.gi_frame.f_locals['.0'] = range(20)
l = list(g)
self.assertListEqual(l, [])

class ExceptionTest(unittest.TestCase):
# Tests for the issue #23353: check that the currently handled exception
# is correctly saved/restored in PyEval_EvalFrameEx().
Expand Down

0 comments on commit 4f52d20

Please sign in to comment.