diff options
author | Victor Stinner <vstinner@python.org> | 2022-11-13 14:37:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-13 14:37:03 (GMT) |
commit | 6788303f5c57273c054d2b9e94e478051d7c8f8d (patch) | |
tree | 0624f6db35a135df5d773563a32c08214a4fbca9 /Lib/test/test_frame.py | |
parent | 57be5459593bbd09583317ebdafc4d58ae51dbf4 (diff) | |
download | cpython-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.py | 6 |
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() |