Raise syntax error if there are both except
and except*
in the same try
block
#14860
Labels
bug
Something isn't working
help wanted
Contributions especially welcome
parser
Related to the parser
The task is to fix this TODO:
ruff/crates/ruff_python_parser/src/parser/statement.rs
Lines 1341 to 1355 in 1bd8fbb
I'd consider this as a bug because the AST marks the entire
try
block as containing anexcept*
and because the parser doesn't raise a syntax error, the formatter will add the*
to allexcept
block (https://play.ruff.rs/059d8f35-5f66-4be5-887e-9f38fa75b40e):CPython parser (not the compiler) also raises a syntax error:
The text was updated successfully, but these errors were encountered: