mirror of
https://github.com/python/cpython.git
synced 2025-07-20 09:45:21 +00:00
[3.10] bpo-34013: Generalize the invalid legacy statement error message (GH-27389). (GH-27391)
(cherry picked from commit 6948964ecf
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
be2415487a
commit
b977f8510e
7 changed files with 339 additions and 246 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue