Skip to content

Commit

Permalink
gh-108179: Add error message for parser stack overflows (#108256)
Browse files Browse the repository at this point in the history
  • Loading branch information
sweeneyde committed Aug 22, 2023
1 parent 7f87ebb commit 8661751
Show file tree
Hide file tree
Showing 5 changed files with 542 additions and 1,063 deletions.
2 changes: 1 addition & 1 deletion Lib/test/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,7 @@ def test_error_on_parser_stack_overflow(self):
source = "-" * 100000 + "4"
for mode in ["exec", "eval", "single"]:
with self.subTest(mode=mode):
with self.assertRaises(MemoryError):
with self.assertRaisesRegex(MemoryError, r"too complex"):
compile(source, "<string>", mode)

@support.cpython_only
Expand Down

0 comments on commit 8661751

Please sign in to comment.