File tree 2 files changed +8
-4
lines changed 2 files changed +8
-4
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}" )
@@ -2362,20 +2365,21 @@ def adjust_int_max_str_digits(max_digits):
2362
2365
finally :
2363
2366
sys .set_int_max_str_digits (current )
2364
2367
2365
- #For recursion tests, easily exceeds default recursion limit
2366
- EXCEEDS_RECURSION_LIMIT = 10_000
2367
2368
2368
2369
def _get_c_recursion_limit ():
2369
2370
try :
2370
2371
import _testcapi
2371
2372
return _testcapi .Py_C_RECURSION_LIMIT
2372
2373
except (ImportError , AttributeError ):
2373
2374
# Originally taken from Include/cpython/pystate.h .
2374
- return 4500
2375
+ return 7000
2375
2376
2376
2377
# The default C recursion limit.
2377
2378
Py_C_RECURSION_LIMIT = _get_c_recursion_limit ()
2378
2379
2380
+ #For recursion tests, easily exceeds default recursion limit
2381
+ EXCEEDS_RECURSION_LIMIT = Py_C_RECURSION_LIMIT * 3
2382
+
2379
2383
#Windows doesn't have os.uname() but it doesn't support s390x.
2380
2384
skip_on_s390x = unittest .skipIf (hasattr (os , 'uname' ) and os .uname ().machine == 's390x' ,
2381
2385
'skipped on s390x' )
You can’t perform that action at this time.
0 commit comments