diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2022-01-03 19:54:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 19:54:06 (GMT) |
commit | dd6c35761a4cd417e126a2d51dd0b89c8a30e5de (patch) | |
tree | ae428b310505891619b4a6a0e65f7aca7db7ada1 /Lib | |
parent | 9d6a239a34a66e16188d76c23a3a770515ca44ca (diff) | |
download | cpython-dd6c35761a4cd417e126a2d51dd0b89c8a30e5de.zip cpython-dd6c35761a4cd417e126a2d51dd0b89c8a30e5de.tar.gz cpython-dd6c35761a4cd417e126a2d51dd0b89c8a30e5de.tar.bz2 |
bpo-46110: Restore commit e9898bf153d26059261ffef11f7643ae991e2a4c
This restores commit e9898bf153d26059261ffef11f7643ae991e2a4c .
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_syntax.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 6286529..c95bc15 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -1729,6 +1729,14 @@ while 1: """ self._check_error(source, "too many statically nested blocks") + @support.cpython_only + 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): + compile(source, "<string>", mode) + def load_tests(loader, tests, pattern): tests.addTest(doctest.DocTestSuite()) |