bpo-43859: Improve the error message for IndentationError exceptions (GH-25431)

This commit is contained in:
Pablo Galindo 2021-04-21 15:28:21 +01:00 committed by GitHub
parent b0544ba77c
commit 56c95dfe27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 2230 additions and 599 deletions

View file

@ -179,7 +179,7 @@ class ExceptionTests(unittest.TestCase):
# should not apply to subclasses, see issue #31161
s = '''if True:\nprint "No indent"'''
ckmsg(s, "expected an indented block", IndentationError)
ckmsg(s, "expected an indented block after 'if' statement on line 1", IndentationError)
s = '''if True:\n print()\n\texec "mixed tabs and spaces"'''
ckmsg(s, "inconsistent use of tabs and spaces in indentation", TabError)