Skip to content

Inconsistent exception types in code "ᵀrue=1" #145675

@Locked-chess-official

Description

@Locked-chess-official

Bug report

Bug description:

It got ValueError in other place when compile without traceback(I think it should be SyntaxError). In IDLE when you run this code it tips SyntaxError (but in compile and exec it can only be caught with ValueError).

Due to that it raised in compile, using SyntaxError to describe it is better.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions