mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
bpo-34013: Generalize the invalid legacy statement error message (GH-27389)
This commit is contained in:
parent
2f54fbafa6
commit
6948964ecf
6 changed files with 337 additions and 244 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