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 {
225
225
# define Py_C_RECURSION_LIMIT 500
226
226
#else
227
227
// This value is duplicated in Lib/test/support/__init__.py
228
- # define Py_C_RECURSION_LIMIT 4500
228
+ # define Py_C_RECURSION_LIMIT 7000
229
229
#endif
230
230
231
231
Original file line number Diff line number Diff line change @@ -2123,6 +2123,9 @@ def set_recursion_limit(limit):
2123
2123
2124
2124
def infinite_recursion (max_depth = None ):
2125
2125
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.
2126
2129
max_depth = 20_000
2127
2130
elif max_depth < 3 :
2128
2131
raise ValueError ("max_depth must be at least 3, got {max_depth}" )
@@ -2371,7 +2374,7 @@ def _get_c_recursion_limit():
2371
2374
return _testcapi .Py_C_RECURSION_LIMIT
2372
2375
except (ImportError , AttributeError ):
2373
2376
# Originally taken from Include/cpython/pystate.h .
2374
- return 4500
2377
+ return 7000
2375
2378
2376
2379
# The default C recursion limit.
2377
2380
Py_C_RECURSION_LIMIT = _get_c_recursion_limit ()
You can’t perform that action at this time.
0 commit comments