Skip to content

Incorrect syntax error #133999

Description

@tom-pytel

Bug report

Bug description:

>>>try: 1/0
... exceptExceptionasexc: raisefromexc
... File"<python-input-0>", line2exceptExceptionasexc: raisefromexc^^^SyntaxError: cannotuseexceptstatementwithname

Should be:

>>>try: 1/0
... except: raisefromValueError()
... File"<python-input-2>", line2except: raisefromValueError()
^^^^SyntaxError: invalidsyntax

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions