[3.12] GH-112215: Backport C recursion changes (GH-115083)

This commit is contained in:
Mark Shannon 2024-02-13 09:45:59 +00:00 committed by GitHub
parent a30bb080dc
commit 4d87832d87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 65 additions and 46 deletions

View file

@ -607,9 +607,9 @@ class TestSpecifics(unittest.TestCase):
# Expected limit is C_RECURSION_LIMIT * 2
# Duplicating the limit here is a little ugly.
# Perhaps it should be exposed somewhere...
fail_depth = C_RECURSION_LIMIT * 2 + 1
fail_depth = C_RECURSION_LIMIT + 1
crash_depth = C_RECURSION_LIMIT * 100
success_depth = int(C_RECURSION_LIMIT * 1.8)
success_depth = int(C_RECURSION_LIMIT * 0.9)
def check_limit(prefix, repeated, mode="single"):
expect_ok = prefix + repeated * success_depth