Skip to content

Commit c66d22d

Browse files
committed
Except operator cases from delete error rule
1 parent f51ad19 commit c66d22d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/test/test_syntax.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,8 +1330,6 @@ def test_curly_brace_after_primary_raises_immediately(self):
13301330
def test_assign_call(self):
13311331
self._check_error("f() = 1", "assign")
13321332

1333-
# TODO: RUSTPYTHON
1334-
@unittest.expectedFailure
13351333
def test_assign_del(self):
13361334
self._check_error("del (,)", "invalid syntax")
13371335
self._check_error("del 1", "cannot delete literal")

compiler/src/compile.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,9 @@ impl Compiler {
852852
self.compile_delete(element)?;
853853
}
854854
}
855+
ast::ExprKind::BinOp { .. } | ast::ExprKind::UnaryOp { .. } => {
856+
return Err(self.error(CompileErrorType::Delete("expression")))
857+
}
855858
_ => return Err(self.error(CompileErrorType::Delete(expression.node.name()))),
856859
}
857860
Ok(())

0 commit comments

Comments
 (0)