https://github.com/python/cpython/commit/2ef769812755da6fe64cef03e7466684f0431bb2
commit: 2ef769812755da6fe64cef03e7466684f0431bb2
branch: 3.13
author: Malcolm Smith <[email protected]>
committer: Eclips4 <[email protected]>
date: 2025-12-08T12:37:53+02:00
summary:

[3.13] gh-141794: Reduce size of compiler stress tests to fix Android warnings 
(GH-142263) (#142409)

(cherry picked from commit f193c8fe9e1d722c9a7f9a2b15f8f1b913755491)

files:
M Lib/test/test_compile.py

diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 06b5fd5bbc8318..cdc8d8ef539f81 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -993,11 +993,13 @@ def test_path_like_objects(self):
         # 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, "<dummy>", "exec")
+        # Android test devices have less memory.
+        size = 100_000 if sys.platform == "android" else 200_000
+        compile("if a: b\n" * size, "<dummy>", "exec")
 
     # Multiple users rely on the fact that CPython does not generate
     # bytecode for dead code blocks. See bpo-37500 for more context.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to