mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
gh-91248: Optimize PyFrame_GetVar() (#99252)
PyFrame_GetVar() no longer creates a temporary dictionary to get a variable.
This commit is contained in:
parent
57be545959
commit
6788303f5c
3 changed files with 146 additions and 97 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue