From f2029b16cb96fed293925de0faec409e3af29022 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 15 May 2024 08:50:48 -0400 Subject: [PATCH] Accommodate FrameLocalsProxy introduction Python 3.13 The `frame.f_locals` is now a write-through proxy object of type `FrameLocalsProxy`; see PEP 667. This fix is based on https://github.com/zopefoundation/zope.interface/pull/294 and specifically on https://github.com/zopefoundation/zope.interface/pull/294#issuecomment-2109776671. Fixes #91. --- tests/test_advice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_advice.py b/tests/test_advice.py index df2f5c0..d2a5a8d 100644 --- a/tests/test_advice.py +++ b/tests/test_advice.py @@ -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)