Skip to content

Commit e2ddcbe

Browse files
committed
Add a test case.
1 parent 78b842c commit e2ddcbe

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Lib/test/test_types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,11 @@ def call(part):
711711
"""
712712
assert_python_ok("-c", code)
713713

714+
def test_frame_locals_proxy(self):
715+
frame = inspect.currentframe()
716+
self.assertIsNotNone(frame)
717+
self.assertIsInstance(frame.f_locals, types.FrameLocalsProxy)
718+
714719

715720
class UnionTests(unittest.TestCase):
716721

Lib/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _m(self): pass
6969
EllipsisType = type(Ellipsis)
7070
NoneType = type(None)
7171
NotImplementedType = type(NotImplemented)
72-
FrameLocalsProxy = (lambda: type(sys._getframe().f_locals)()
72+
FrameLocalsProxy = (lambda: type(sys._getframe().f_locals))()
7373

7474
# CapsuleType cannot be accessed from pure Python,
7575
# so there is no fallback definition.

0 commit comments

Comments
 (0)