mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)
Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
This commit is contained in:
parent
a81849b031
commit
c5fc156852
91 changed files with 27057 additions and 146 deletions
|
@ -8,6 +8,7 @@ import pickle
|
|||
import unittest
|
||||
import operator
|
||||
import struct
|
||||
import sys
|
||||
from test import support
|
||||
from test.support.script_helper import assert_python_failure
|
||||
from test.support.script_helper import assert_python_ok
|
||||
|
@ -899,9 +900,10 @@ class ParserStackLimitTestCase(unittest.TestCase):
|
|||
st = parser.expr(e)
|
||||
st.compile()
|
||||
|
||||
@unittest.skipIf(sys.flags.use_peg, "Pegen does not trigger memory error with this many parenthesis")
|
||||
def test_trigger_memory_error(self):
|
||||
e = self._nested_expression(100)
|
||||
rc, out, err = assert_python_failure('-c', e)
|
||||
rc, out, err = assert_python_failure('-Xoldparser', '-c', e)
|
||||
# parsing the expression will result in an error message
|
||||
# followed by a MemoryError (see #11963)
|
||||
self.assertIn(b's_push: parser stack overflow', err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue