Skip to content

(🎁) Report better errors with syntax errors from the future #12357

Closed
@KotlinIsland

Description

@KotlinIsland

look at this playground

even though "Python 3.10" (--python-version 3.10) is specified it still fails with a syntax error. This is not exactly obvious from the error:

main.py:2: error: invalid syntax
Found 1 error in 1 file (errors prevented further checking)

Perhaps something a little more telling could be said?

main.py:2: error: invalid syntax
main.py:2: note: perhaps this syntax comes from the future(🔮), you are only on ancient(🦕) python 3.9 after all
Found 1 error in 1 file (errors prevented further checking)

If should probably only get mentioned if you specify a --python-version higher than the interpreter.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions