File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
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}" )
@@ -2362,20 +2365,21 @@ def adjust_int_max_str_digits(max_digits):
23622365 finally :
23632366 sys .set_int_max_str_digits (current )
23642367
2365- #For recursion tests, easily exceeds default recursion limit
2366- EXCEEDS_RECURSION_LIMIT = 10_000
23672368
23682369def _get_c_recursion_limit ():
23692370 try :
23702371 import _testcapi
23712372 return _testcapi .Py_C_RECURSION_LIMIT
23722373 except (ImportError , AttributeError ):
23732374 # Originally taken from Include/cpython/pystate.h .
2374- return 4500
2375+ return 7000
23752376
23762377# The default C recursion limit.
23772378Py_C_RECURSION_LIMIT = _get_c_recursion_limit ()
23782379
2380+ #For recursion tests, easily exceeds default recursion limit
2381+ EXCEEDS_RECURSION_LIMIT = Py_C_RECURSION_LIMIT * 3
2382+
23792383#Windows doesn't have os.uname() but it doesn't support s390x.
23802384skip_on_s390x = unittest .skipIf (hasattr (os , 'uname' ) and os .uname ().machine == 's390x' ,
23812385 'skipped on s390x' )
You can’t perform that action at this time.
0 commit comments