Skip to content

Commit bb4ef3e

Browse files
carljmCarl Meyer
authored andcommitted
add compiler test for another case of excessive stack use
1 parent b9dedfe commit bb4ef3e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_compile.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,13 @@ def test_stack_3050(self):
16451645
# This raised on 3.10.0 to 3.10.5
16461646
compile(code, "<foo>", "single")
16471647

1648+
def test_stack_3050_2(self):
1649+
M = 3050
1650+
args = ", ".join(f"arg{i}:type{i}" for i in range(M))
1651+
code = f"def f({args}):\n pass"
1652+
# This raised on 3.10.0 to 3.10.5
1653+
compile(code, "<foo>", "single")
1654+
16481655

16491656
class TestStackSizeStability(unittest.TestCase):
16501657
# Check that repeating certain snippets doesn't increase the stack size

0 commit comments

Comments
 (0)