gh-108179: Add error message for parser stack overflows (#108256)

This commit is contained in:
Dennis Sweeney 2023-08-22 03:41:50 -04:00 committed by GitHub
parent 7f87ebbc3f
commit 86617518c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 542 additions and 1063 deletions

View file

@ -2335,7 +2335,7 @@ while 1:
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