File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ struct _ts {
225225# define Py_C_RECURSION_LIMIT 500
226226#else
227227 // This value is duplicated in Lib/test/support/__init__.py
228- # define Py_C_RECURSION_LIMIT 4500
228+ # define Py_C_RECURSION_LIMIT 7000
229229#endif
230230
231231
Original file line number Diff line number Diff line change @@ -2123,6 +2123,9 @@ def set_recursion_limit(limit):
21232123
21242124def infinite_recursion (max_depth = None ):
21252125 if max_depth is None :
2126+ # Pick a number large enough to cause problems
2127+ # but not take too long for code that can handle
2128+ # very deep recursion.
21262129 max_depth = 20_000
21272130 elif max_depth < 3 :
21282131 raise ValueError ("max_depth must be at least 3, got {max_depth}" )
@@ -2371,7 +2374,7 @@ def _get_c_recursion_limit():
23712374 return _testcapi .Py_C_RECURSION_LIMIT
23722375 except (ImportError , AttributeError ):
23732376 # Originally taken from Include/cpython/pystate.h .
2374- return 4500
2377+ return 7000
23752378
23762379# The default C recursion limit.
23772380Py_C_RECURSION_LIMIT = _get_c_recursion_limit ()
You can’t perform that action at this time.
0 commit comments