GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510)

This commit is contained in:
Mark Shannon 2022-10-05 01:34:03 +01:00 committed by GitHub
parent 0ff8fd6583
commit 76449350b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 165 additions and 99 deletions

View file

@ -825,9 +825,9 @@ class AST_Tests(unittest.TestCase):
@support.cpython_only
def test_ast_recursion_limit(self):
fail_depth = sys.getrecursionlimit() * 3
crash_depth = sys.getrecursionlimit() * 300
success_depth = int(fail_depth * 0.75)
fail_depth = support.EXCEEDS_RECURSION_LIMIT
crash_depth = 100_000
success_depth = 1200
def check_limit(prefix, repeated):
expect_ok = prefix + repeated * success_depth