Skip to content

Commit c5d7596

Browse files
committed
fix tests
1 parent 91f95de commit c5d7596

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/test/test_code.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,11 @@ def foo(a, b):
604604
c = foo.__code__
605605

606606
fss = support.get_frame_specials_size()
607-
ps = ctypes.sizeof(ctypes.c_void_p) # sizeof(PyObject *)
608607
co_nlocalsplus = len({*c.co_varnames, *c.co_cellvars, *c.co_freevars})
609608
# anything below that limit is a valid co_stacksize
610-
evil_stacksize = int(_testcapi.INT_MAX / ps - fss - co_nlocalsplus)
609+
evil_stacksize = int(_testcapi.INT_MAX / 16 - fss - co_nlocalsplus)
611610

612-
with self.assertRaisesRegex(OverflowError, "co_stacksize"):
611+
with self.assertRaisesRegex(OverflowError, "stack size is too large"):
613612
c.__replace__(co_stacksize=evil_stacksize)
614613
c.__replace__(co_stacksize=evil_stacksize - 1)
615614

0 commit comments

Comments
 (0)