You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch raises an IndentationError rather than a
generic "invalid syntax" error for unexpected
indentation. Code to do this was already in
pythonrun.c:err_input() but was not being reached due
to a failure to pass the INDENT token in the perrdetail
structure. The patch also adds tests for the 3 kinds
of indentation errors (unexpected indent, no indent
where required, invalid outdent level) to test_syntax.py .
IndentationError is already raised for bad indentation, e.g.
for
"def f():\nreturn"
or
if1:\nfoo()" (whichisthetest_no_indent)
However, the patch is right in filling the token in this
case, also; I accepted it as r45897. As it changes the
exceptio behaviour, I don't think it should be backported.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: