GH-112215: Increase C recursion limit for non debug builds (GH-113397)

This commit is contained in:
Mark Shannon 2023-12-22 14:25:25 +00:00 committed by GitHub
parent 5f665e99e0
commit 45e09f921b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 21 deletions

View file

@ -1862,6 +1862,20 @@ class TestLRU:
self.assertEqual(str(Signature.from_callable(lru.cache_info)), '()')
self.assertEqual(str(Signature.from_callable(lru.cache_clear)), '()')
@support.skip_on_s390x
@unittest.skipIf(support.is_wasi, "WASI has limited C stack")
def test_lru_recursion(self):
@self.module.lru_cache
def fib(n):
if n <= 1:
return n
return fib(n-1) + fib(n-2)
if not support.Py_DEBUG:
with support.infinite_recursion():
fib(2500)
@py_functools.lru_cache()
def py_cached_func(x, y):