Skip to content
Prev Previous commit
Next Next commit
Fix failing test
  • Loading branch information
ShaharNaveh committed May 19, 2026
commit 1c87dddd9b20250b8e8a9c44524ed0932c502b10
10 changes: 4 additions & 6 deletions Lib/test/test_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1417,9 +1417,8 @@ def test_try(self):
else: pass
try: 1/0
except (EOFError, TypeError, ZeroDivisionError): pass
# TODO: RUSTPYTHON; SyntaxError: multiple exception types must be parenthesized
# try: 1/0
# except EOFError, TypeError, ZeroDivisionError: pass
try: 1/0
except EOFError, TypeError, ZeroDivisionError: pass
try: 1/0
except (EOFError, TypeError, ZeroDivisionError) as msg: pass
try: pass
Expand All @@ -1443,9 +1442,8 @@ def test_try_star(self):
else: pass
try: 1/0
except* (EOFError, TypeError, ZeroDivisionError): pass
# TODO: RUSTPYTHON; SyntaxError: multiple exception types must be parenthesized
# try: 1/0
# except* EOFError, TypeError, ZeroDivisionError: pass
try: 1/0
except* EOFError, TypeError, ZeroDivisionError: pass
try: 1/0
except* (EOFError, TypeError, ZeroDivisionError) as msg: pass
try: pass
Expand Down
9 changes: 0 additions & 9 deletions crates/codegen/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4446,15 +4446,6 @@ impl Compiler {

// Compile exception type
if let Some(exc_type) = type_ {
// Check for unparenthesized tuple
if let ast::Expr::Tuple(ast::ExprTuple { elts, range, .. }) = exc_type.as_ref()
&& let Some(first) = elts.first()
&& range.start().to_u32() == first.range().start().to_u32()
{
return Err(self.error(CodegenErrorType::SyntaxError(
"multiple exception types must be parenthesized".to_owned(),
)));
}
self.compile_expression(exc_type)?;
} else {
return Err(self.error(CodegenErrorType::SyntaxError(
Expand Down
Loading