@@ -2112,12 +2112,7 @@ def set_recursion_limit(limit):
2112
2112
finally :
2113
2113
sys .setrecursionlimit (original_limit )
2114
2114
2115
- def infinite_recursion (max_depth = 100 ):
2116
- """Set a lower limit for tests that interact with infinite recursions
2117
- (e.g test_ast.ASTHelpers_Test.test_recursion_direct) since on some
2118
- debug windows builds, due to not enough functions being inlined the
2119
- stack size might not handle the default recursion limit (1000). See
2120
- bpo-11105 for details."""
2115
+ def infinite_recursion (max_depth = 20_000 ):
2121
2116
if max_depth < 3 :
2122
2117
raise ValueError ("max_depth must be at least 3, got {max_depth}" )
2123
2118
depth = get_recursion_depth ()
@@ -2356,11 +2351,12 @@ def adjust_int_max_str_digits(max_digits):
2356
2351
finally :
2357
2352
sys .set_int_max_str_digits (current )
2358
2353
2359
- #For recursion tests, easily exceeds default recursion limit
2360
- EXCEEDS_RECURSION_LIMIT = 5000
2361
2354
2362
2355
# The default C recursion limit (from Include/cpython/pystate.h).
2363
- C_RECURSION_LIMIT = 1500
2356
+ C_RECURSION_LIMIT = 8000
2357
+
2358
+ #For recursion tests, easily exceeds default recursion limit
2359
+ EXCEEDS_RECURSION_LIMIT = C_RECURSION_LIMIT * 3
2364
2360
2365
2361
#Windows doesn't have os.uname() but it doesn't support s390x.
2366
2362
skip_on_s390x = unittest .skipIf (hasattr (os , 'uname' ) and os .uname ().machine == 's390x' ,
0 commit comments