Since #29513, syntax errors in `else` and `elif` blocks, like: ```python 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? <!-- gh-linked-prs --> ### Linked PRs * gh-119974 * gh-120013 <!-- /gh-linked-prs -->
Since #29513, syntax errors in
elseandelifblocks, like:are reported at the
else:This is quite unhelpful when a small typo is hiding in a large block.
@lysnikolaou, could you take a look?
Linked PRs