Skip to content

Commit 8661751

Browse files
authored
gh-108179: Add error message for parser stack overflows (#108256)
1 parent 7f87ebb commit 8661751

File tree

5 files changed

+542
-1063
lines changed

5 files changed

+542
-1063
lines changed

Lib/test/test_syntax.py

+1-1
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)