diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-07-27 17:52:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-27 17:52:32 (GMT) |
commit | b977f8510e2ff4f11e3bda920722098a242fc8cc (patch) | |
tree | 2e482298654ce04f9a484606f75ee6b63ba7ea2c /Lib/test/test_exceptions.py | |
parent | be2415487ab80e4bd5ace2954651e78b107b17e4 (diff) | |
download | cpython-b977f8510e2ff4f11e3bda920722098a242fc8cc.zip cpython-b977f8510e2ff4f11e3bda920722098a242fc8cc.tar.gz cpython-b977f8510e2ff4f11e3bda920722098a242fc8cc.tar.bz2 |
[3.10] bpo-34013: Generalize the invalid legacy statement error message (GH-27389). (GH-27391)
(cherry picked from commit 6948964ecf94e858448dd28eea634317226d2913)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index a2bc62b..8caac2c 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) |