summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_eof.py
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-04-28 00:23:35 (GMT)
committerGitHub <noreply@github.com>2020-04-28 00:23:35 (GMT)
commitd55133f49fe678fbf047a647aa8bb8b520410e8d (patch)
treedb31a77eb0f6afec122315b46c74597f1f4f9441 /Lib/test/test_eof.py
parent5d1f32d33ba24d0aa87235ae40207bb57778388b (diff)
downloadcpython-d55133f49fe678fbf047a647aa8bb8b520410e8d.zip
cpython-d55133f49fe678fbf047a647aa8bb8b520410e8d.tar.gz
cpython-d55133f49fe678fbf047a647aa8bb8b520410e8d.tar.bz2
bpo-40334: Catch E_EOF error, when the tokenizer returns ERRORTOKEN (GH-19743)
An E_EOF error was only being caught after the parser exited before this commit. There are some cases though, where the tokenizer returns ERRORTOKEN *and* has set an E_EOF error (like when EOF directly follows a line continuation character) which weren't correctly handled before.
Diffstat (limited to 'Lib/test/test_eof.py')
-rw-r--r--Lib/test/test_eof.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py
index f806578..9ef8eb1 100644
--- a/Lib/test/test_eof.py
+++ b/Lib/test/test_eof.py
@@ -26,7 +26,6 @@ class EOFTestCase(unittest.TestCase):
else:
raise support.TestFailed
- @support.skip_if_new_parser("TODO for PEG -- fails with new parser")
def test_line_continuation_EOF(self):
"""A continuation at the end of input must be an error; bpo2180."""
expect = 'unexpected EOF while parsing (<string>, line 1)'
@@ -37,7 +36,6 @@ class EOFTestCase(unittest.TestCase):
exec('\\')
self.assertEqual(str(excinfo.exception), expect)
- @unittest.skip("TODO for PEG -- fails even with old parser now")
@unittest.skipIf(not sys.executable, "sys.executable required")
def test_line_continuation_EOF_from_file_bpo2180(self):
"""Ensure tok_nextc() does not add too many ending newlines."""