@@ -728,7 +728,8 @@ def test_yet_more_evil_still_undecodable(self):
728728 def test_compiler_recursion_limit (self ):
729729 # Compiler frames are small
730730 limit = 100
731- crash_depth = limit * 5000
731+ # Android test devices have less memory.
732+ crash_depth = limit * (1000 if sys .platform == "android" else 5000 )
732733 success_depth = limit
733734
734735 def check_limit (prefix , repeated , mode = "single" ):
@@ -1036,11 +1037,13 @@ def test_path_like_objects(self):
10361037 # An implicit test for PyUnicode_FSDecoder().
10371038 compile ("42" , FakePath ("test_compile_pathlike" ), "single" )
10381039
1040+ # bpo-31113: Stack overflow when compile a long sequence of
1041+ # complex statements.
10391042 @support .requires_resource ('cpu' )
10401043 def test_stack_overflow (self ):
1041- # bpo-31113: Stack overflow when compile a long sequence of
1042- # complex statements.
1043- compile ("if a: b\n " * 200000 , "<dummy>" , "exec" )
1044+ # Android test devices have less memory.
1045+ size = 100_000 if sys . platform == "android" else 200_000
1046+ compile ("if a: b\n " * size , "<dummy>" , "exec" )
10441047
10451048 # Multiple users rely on the fact that CPython does not generate
10461049 # bytecode for dead code blocks. See bpo-37500 for more context.
0 commit comments