Skip to content

Commit 149d70c

Browse files
[3.12] gh-108179: Add error message for parser stack overflows (GH-108256) (#108263)
gh-108179: Add error message for parser stack overflows (GH-108256) (cherry picked from commit 8661751) Co-authored-by: Dennis Sweeney <[email protected]>
1 parent ef4d427 commit 149d70c

File tree

5 files changed

+542
-1063
lines changed

5 files changed

+542
-1063
lines changed

Lib/test/test_syntax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2335,7 +2335,7 @@ def test_error_on_parser_stack_overflow(self):
23352335
source = "-" * 100000 + "4"
23362336
for mode in ["exec", "eval", "single"]:
23372337
with self.subTest(mode=mode):
2338-
with self.assertRaises(MemoryError):
2338+
with self.assertRaisesRegex(MemoryError, r"too complex"):
23392339
compile(source, "<string>", mode)
23402340

23412341
@support.cpython_only

0 commit comments

Comments
 (0)