Skip to content

Required indentation blocks throw wrong error when empty #4400

@branai

Description

@branai

If the last thing in the python file is code that would require an indentation to follow it, an IndentationError should be thrown instead of an EOF error.

test.py:
if True:

rustpython:
SyntaxError: Got unexpected EOF at line 2 column 0

cpython:
IndentationError: expected an indented block after 'if' statement on line 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions