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

Syntax errors in else blocks are reported at else #119724

Copy link
Copy link
Closed
@encukou

Description

@encukou
Issue body actions

Since #29513, syntax errors in else and elif blocks, like:

if 1:
    pass
else:
    This is invalid syntax (sic)

are reported at the else:

  File "/tmp/repro.py", line 3
    else:
    ^^^^^^
SyntaxError: 'else' must match a valid statement here

This is quite unhelpful when a small typo is hiding in a large block.

@lysnikolaou, could you take a look?

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesrelease-blocker

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.