summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_functools.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-01-16 09:32:01 (GMT)
committerGitHub <noreply@github.com>2024-01-16 09:32:01 (GMT)
commit17b73ab99ef12f89d41acec7500a244e68b1aaa4 (patch)
treebcde8fca4dc4dae4f9ed5369a4ea23bb825f15bb /Lib/test/test_functools.py
parent6c502ba809ff662a5eebf8c6778dec6bd28918fb (diff)
downloadcpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.zip
cpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.tar.gz
cpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.tar.bz2
GH-113655: Lower the C recursion limit on various platforms (GH-113944)
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r--Lib/test/test_functools.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 0ef45d3..7c66b90 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1875,8 +1875,14 @@ class TestLRU:
return fib(n-1) + fib(n-2)
if not support.Py_DEBUG:
+ depth = support.Py_C_RECURSION_LIMIT*2//7
with support.infinite_recursion():
- fib(2500)
+ fib(depth)
+ if self.module == c_functools:
+ fib.cache_clear()
+ with support.infinite_recursion():
+ with self.assertRaises(RecursionError):
+ fib(10000)
@py_functools.lru_cache()