summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_frame.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-13 14:37:03 (GMT)
committerGitHub <noreply@github.com>2022-11-13 14:37:03 (GMT)
commit6788303f5c57273c054d2b9e94e478051d7c8f8d (patch)
tree0624f6db35a135df5d773563a32c08214a4fbca9 /Lib/test/test_frame.py
parent57be5459593bbd09583317ebdafc4d58ae51dbf4 (diff)
downloadcpython-6788303f5c57273c054d2b9e94e478051d7c8f8d.zip
cpython-6788303f5c57273c054d2b9e94e478051d7c8f8d.tar.gz
cpython-6788303f5c57273c054d2b9e94e478051d7c8f8d.tar.bz2
gh-91248: Optimize PyFrame_GetVar() (#99252)
PyFrame_GetVar() no longer creates a temporary dictionary to get a variable.
Diffstat (limited to 'Lib/test/test_frame.py')
-rw-r--r--Lib/test/test_frame.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_frame.py b/Lib/test/test_frame.py
index ada9666..a7db220 100644
--- a/Lib/test/test_frame.py
+++ b/Lib/test/test_frame.py
@@ -352,6 +352,12 @@ class TestCAPI(unittest.TestCase):
with self.assertRaises(NameError):
_testcapi.frame_getvarstring(current_frame, b"y")
+ # wrong name type
+ with self.assertRaises(TypeError):
+ _testcapi.frame_getvar(current_frame, b'x')
+ with self.assertRaises(TypeError):
+ _testcapi.frame_getvar(current_frame, 123)
+
def getgenframe(self):
yield sys._getframe()