Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Incorrect syntax error #133999

Copy link
Copy link
Closed
Closed
Copy link
@tom-pytel

Description

@tom-pytel
Issue body actions

Bug report

Bug description:

>>> try: 1/0
... except Exception as exc: raise from exc
... 
  File "<python-input-0>", line 2
    except Exception as exc: raise from exc
                        ^^^
SyntaxError: cannot use except statement with name

Should be:

>>> try: 1/0
... except: raise from ValueError()
... 
  File "<python-input-2>", line 2
    except: raise from ValueError()
                  ^^^^
SyntaxError: invalid syntax

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

Status

Done
Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.