File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -816,9 +816,9 @@ def next(self):
816816
817817 @support .cpython_only
818818 def test_ast_recursion_limit (self ):
819- fail_depth = sys . getrecursionlimit () * 3
820- crash_depth = sys . getrecursionlimit () * 300
821- success_depth = int ( fail_depth * 0.75 )
819+ fail_depth = 5000
820+ crash_depth = 100_000
821+ success_depth = 1200
822822
823823 def check_limit (prefix , repeated ):
824824 expect_ok = prefix + repeated * success_depth
Original file line number Diff line number Diff line change @@ -140,11 +140,11 @@ class MyGlobals(dict):
140140 def __missing__ (self , key ):
141141 return int (key .removeprefix ("_number_" ))
142142
143- # 1,000 on most systems
144- limit = sys . getrecursionlimit ()
145- code = "lambda: " + "+" .join (f"_number_{ i } " for i in range (limit ))
143+ # Need more than 256 variables to use EXTENDED_ARGS
144+ variables = 400
145+ code = "lambda: " + "+" .join (f"_number_{ i } " for i in range (variables ))
146146 sum_func = eval (code , MyGlobals ())
147- expected = sum (range (limit ))
147+ expected = sum (range (variables ))
148148 # Warm up the the function for quickening (PEP 659)
149149 for _ in range (30 ):
150150 self .assertEqual (sum_func (), expected )
You can’t perform that action at this time.
0 commit comments