aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-07-27 17:19:22 +0100
committerGitHub <noreply@github.com>2021-07-27 17:19:22 +0100
commit6948964ecf94e858448dd28eea634317226d2913 (patch)
tree31cf0a4e617bbf2a8d1edbac809b9b494da9b980 /Lib/test/test_exceptions.py
parent2f54fbafa6481fb10528cb1d3d6b517ca2a4647f (diff)
downloadcpython-6948964ecf94e858448dd28eea634317226d2913.tar.gz
cpython-6948964ecf94e858448dd28eea634317226d2913.zip
bpo-34013: Generalize the invalid legacy statement error message (GH-27389)
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 31051d4a8d0..8ebed02ca4b 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -175,9 +175,15 @@ class ExceptionTests(unittest.TestCase):
ckmsg(s, "Missing parentheses in call to 'print'. "
"Did you mean print(\"old style\", end=\" \")?")
+ s = 'print f(a+b,c)'
+ ckmsg(s, "Missing parentheses in call to 'print'.")
+
s = '''exec "old style"'''
ckmsg(s, "Missing parentheses in call to 'exec'")
+ s = 'exec f(a+b,c)'
+ ckmsg(s, "Missing parentheses in call to 'exec'.")
+
# should not apply to subclasses, see issue #31161
s = '''if True:\nprint "No indent"'''
ckmsg(s, "expected an indented block after 'if' statement on line 1", IndentationError)