mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510)
This commit is contained in:
parent
0ff8fd6583
commit
76449350b3
22 changed files with 165 additions and 99 deletions
|
@ -140,11 +140,11 @@ class RebindBuiltinsTests(unittest.TestCase):
|
|||
def __missing__(self, key):
|
||||
return int(key.removeprefix("_number_"))
|
||||
|
||||
# 1,000 on most systems
|
||||
limit = sys.getrecursionlimit()
|
||||
code = "lambda: " + "+".join(f"_number_{i}" for i in range(limit))
|
||||
# Need more than 256 variables to use EXTENDED_ARGS
|
||||
variables = 400
|
||||
code = "lambda: " + "+".join(f"_number_{i}" for i in range(variables))
|
||||
sum_func = eval(code, MyGlobals())
|
||||
expected = sum(range(limit))
|
||||
expected = sum(range(variables))
|
||||
# Warm up the the function for quickening (PEP 659)
|
||||
for _ in range(30):
|
||||
self.assertEqual(sum_func(), expected)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue