[New-bugs-announce] [issue43859] Improve syntax error for indentation errors
Pablo Galindo Salgado
report at bugs.python.org
Thu Apr 15 20:26:09 EDT 2021
New submission from Pablo Galindo Salgado <pablogsal at gmail.com>:
The current indentation error is quite simplistic and it does not include the context of the statement that was associated with the indented block and where it was:
>>> def foo():
... if lel:
... x = 2
File "<stdin>", line 3
x = 2
^
IndentationError: expected an indented block
we can improve the error by adding some context:
>>> def foo():
... if lel:
... x = 2
File "<stdin>", line 3
x = 2
^
IndentationError: expected an indented block after if statement in line 2
----------
messages: 391160
nosy: ammar2, pablogsal
priority: normal
severity: normal
status: open
title: Improve syntax error for indentation errors
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43859>
_______________________________________
More information about the New-bugs-announce
mailing list