We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91f95de commit c5d7596Copy full SHA for c5d7596
Lib/test/test_code.py
@@ -604,12 +604,11 @@ def foo(a, b):
604
c = foo.__code__
605
606
fss = support.get_frame_specials_size()
607
- ps = ctypes.sizeof(ctypes.c_void_p) # sizeof(PyObject *)
608
co_nlocalsplus = len({*c.co_varnames, *c.co_cellvars, *c.co_freevars})
609
# anything below that limit is a valid co_stacksize
610
- evil_stacksize = int(_testcapi.INT_MAX / ps - fss - co_nlocalsplus)
+ evil_stacksize = int(_testcapi.INT_MAX / 16 - fss - co_nlocalsplus)
611
612
- with self.assertRaisesRegex(OverflowError, "co_stacksize"):
+ with self.assertRaisesRegex(OverflowError, "stack size is too large"):
613
c.__replace__(co_stacksize=evil_stacksize)
614
c.__replace__(co_stacksize=evil_stacksize - 1)
615
0 commit comments