aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-11-08 13:16:28 -0800
committerGitHub <noreply@github.com>2022-11-08 13:16:28 -0800
commit1565db7020be2ed66c2777897c3f54974828baf5 (patch)
tree986125d3bbf4ae56d870ca74d0ea1bc541f63773
parentgh-99238: clarify the type of the env dict. (GH-99253) (diff)
downloadcpython-1565db7020be2ed66c2777897c3f54974828baf5.tar.gz
cpython-1565db7020be2ed66c2777897c3f54974828baf5.tar.bz2
cpython-1565db7020be2ed66c2777897c3f54974828baf5.zip
gh-94445: add compiler test for another case of excessive stack use (GH-99237)
(cherry picked from commit 027bc7e6bba93777c80300953579266818d339e7) Co-authored-by: Carl Meyer <carl@oddbird.net>
-rw-r--r--Lib/test/test_compile.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 23f84b48fac..54e90663ab5 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -1394,6 +1394,13 @@ class TestExpressionStackSize(unittest.TestCase):
# This raised on 3.10.0 to 3.10.5
compile(code, "<foo>", "single")
+ def test_stack_3050_2(self):
+ M = 3050
+ args = ", ".join(f"arg{i}:type{i}" for i in range(M))
+ code = f"def f({args}):\n pass"
+ # This raised on 3.10.0 to 3.10.5
+ compile(code, "<foo>", "single")
+
class TestStackSizeStability(unittest.TestCase):
# Check that repeating certain snippets doesn't increase the stack size