aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index f41426a4e9d..0c207ec8fc0 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -858,6 +858,20 @@ class SyntaxTestCase(unittest.TestCase):
"iterable argument unpacking follows "
"keyword argument unpacking")
+ def test_empty_line_after_linecont(self):
+ # See issue-40847
+ s = r"""\
+pass
+ \
+
+pass
+"""
+ try:
+ compile(s, '<string>', 'exec')
+ except SyntaxError:
+ self.fail("Empty line after a line continuation character is valid.")
+
+
def test_main():
support.run_unittest(SyntaxTestCase)
from test import test_syntax