@@ -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" ):
@@ -1030,11 +1031,13 @@ def test_path_like_objects(self):
10301031 # An implicit test for PyUnicode_FSDecoder().
10311032 compile ("42" , FakePath ("test_compile_pathlike" ), "single" )
10321033
1034+ # bpo-31113: Stack overflow when compile a long sequence of
1035+ # complex statements.
10331036 @support .requires_resource ('cpu' )
10341037 def test_stack_overflow (self ):
1035- # bpo-31113: Stack overflow when compile a long sequence of
1036- # complex statements.
1037- compile ("if a: b\n " * 200000 , "<dummy>" , "exec" )
1038+ # Android test devices have less memory.
1039+ size = 100_000 if sys . platform == "android" else 200_000
1040+ compile ("if a: b\n " * size , "<dummy>" , "exec" )
10381041
10391042 # Multiple users rely on the fact that CPython does not generate
10401043 # bytecode for dead code blocks. See bpo-37500 for more context.
0 commit comments