@@ -2112,12 +2112,7 @@ def set_recursion_limit(limit):
21122112 finally :
21132113 sys .setrecursionlimit (original_limit )
21142114
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 ):
21212116 if max_depth < 3 :
21222117 raise ValueError ("max_depth must be at least 3, got {max_depth}" )
21232118 depth = get_recursion_depth ()
@@ -2356,11 +2351,12 @@ def adjust_int_max_str_digits(max_digits):
23562351 finally :
23572352 sys .set_int_max_str_digits (current )
23582353
2359- #For recursion tests, easily exceeds default recursion limit
2360- EXCEEDS_RECURSION_LIMIT = 5000
23612354
23622355# 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
23642360
23652361#Windows doesn't have os.uname() but it doesn't support s390x.
23662362skip_on_s390x = unittest .skipIf (hasattr (os , 'uname' ) and os .uname ().machine == 's390x' ,
0 commit comments