summaryrefslogtreecommitdiff
path: root/Lib/test/test_eof.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-05-08 03:38:44 +0100
committerGitHub <noreply@github.com>2020-05-08 03:38:44 +0100
commitdb9163ceef31ba00ccb23226917f9c8e9142a0b8 (patch)
treedb8ef3bf719774bf6d1f0aab96f1cf65403a77b7 /Lib/test/test_eof.py
parentb7a78ca74ab539943ab11b5c4c9cfab7f5b7ff5a (diff)
downloadcpython-git-db9163ceef31ba00ccb23226917f9c8e9142a0b8.tar.gz
bpo-40555: Check for p->error_indicator in loop rules after the main loop is done (GH-19986)
Diffstat (limited to 'Lib/test/test_eof.py')
-rw-r--r--Lib/test/test_eof.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py
index 9ef8eb1187..bebad31061 100644
--- a/Lib/test/test_eof.py
+++ b/Lib/test/test_eof.py
@@ -26,6 +26,15 @@ class EOFTestCase(unittest.TestCase):
else:
raise support.TestFailed
+ def test_eof_with_line_continuation(self):
+ expect = "unexpected EOF while parsing (<string>, line 1)"
+ try:
+ compile('"\\xhh" \\', '<string>', 'exec', dont_inherit=True)
+ except SyntaxError as msg:
+ self.assertEqual(str(msg), expect)
+ else:
+ raise support.TestFailed
+
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)'