Skip to content

Commit

Permalink
Accommodate FrameLocalsProxy introduction in Python 3.13
Browse files Browse the repository at this point in the history
The `frame.f_locals` is now a write-through proxy object of type
`FrameLocalsProxy`; see PEP 667. This fix is based on
zopefoundation/zope.interface#294 and
specifically on
zopefoundation/zope.interface#294 (comment).

Fixes #91.
  • Loading branch information
musicinmybrain committed May 15, 2024
1 parent 966cce8 commit 000b36d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_advice.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def testCallInfo(self):
sys._getframe()
)
self.assertEqual(kind, "function call")
self.assertTrue(f_locals is locals()) # ???
frame = sys._getframe()
self.assertEqual(f_locals, frame.f_locals)
self.assertEqual(f_locals, locals())
for d in module.__dict__, f_globals:
self.assertTrue(d is globals())
self.assertEqual(len(codeinfo), 4)

0 comments on commit 000b36d

Please sign in to comment.