diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_gdb.py | 11 | ||||
-rw-r--r-- | Lib/test/test_sys.py | 6 |
2 files changed, 7 insertions, 10 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 22c75bae987..7bdef25c763 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -666,15 +666,16 @@ id(a)''') def test_frames(self): gdb_output = self.get_stack_trace(''' +import sys def foo(a, b, c): - pass + return sys._getframe(0) -foo(3, 4, 5) -id(foo.__code__)''', +f = foo(3, 4, 5) +id(f)''', breakpoint='builtin_id', - cmds_after_breakpoint=['print (PyFrameObject*)(((PyCodeObject*)v)->co_zombieframe)'] + cmds_after_breakpoint=['print (PyFrameObject*)v'] ) - self.assertTrue(re.match(r'.*\s+\$1 =\s+Frame 0x-?[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*', + self.assertTrue(re.match(r'.*\s+\$1 =\s+Frame 0x-?[0-9a-f]+, for file <string>, line 4, in foo \(a=3.*', gdb_output, re.DOTALL), 'Unexpected gdb representation: %r\n%s' % (gdb_output, gdb_output)) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 4f266894bfc..6574c4f9b70 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1274,11 +1274,7 @@ class SizeofTest(unittest.TestCase): # frame import inspect x = inspect.currentframe() - ncells = len(x.f_code.co_cellvars) - nfrees = len(x.f_code.co_freevars) - localsplus = x.f_code.co_stacksize + x.f_code.co_nlocals +\ - ncells + nfrees - check(x, vsize('8P3i3c' + localsplus*'P')) + check(x, size('5P3i4cP')) # function def func(): pass check(func, size('14P')) |