From: Malcolm Smith Date: Mon, 8 Dec 2025 10:37:53 +0000 (+0000) Subject: [3.13] gh-141794: Reduce size of compiler stress tests to fix Android warnings (GH... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ef769812755da6fe64cef03e7466684f0431bb2;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-141794: Reduce size of compiler stress tests to fix Android warnings (GH-142263) (#142409) (cherry picked from commit f193c8fe9e1d722c9a7f9a2b15f8f1b913755491) --- diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 06b5fd5bbc83..cdc8d8ef539f 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -993,11 +993,13 @@ class TestSpecifics(unittest.TestCase): # An implicit test for PyUnicode_FSDecoder(). compile("42", FakePath("test_compile_pathlike"), "single") + # bpo-31113: Stack overflow when compile a long sequence of + # complex statements. @support.requires_resource('cpu') def test_stack_overflow(self): - # bpo-31113: Stack overflow when compile a long sequence of - # complex statements. - compile("if a: b\n" * 200000, "", "exec") + # Android test devices have less memory. + size = 100_000 if sys.platform == "android" else 200_000 + compile("if a: b\n" * size, "", "exec") # Multiple users rely on the fact that CPython does not generate # bytecode for dead code blocks. See bpo-37500 for more context.