diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 615212d6024..779d82b9679 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4952,7 +4952,6 @@ class A(int): with self.assertRaises(TypeError): a + a - @unittest.expectedFailure # TODO: RUSTPYTHON def test_slot_shadows_class_variable(self): with self.assertRaises(ValueError) as cm: class X: @@ -4961,7 +4960,6 @@ class X: m = str(cm.exception) self.assertEqual("'foo' in __slots__ conflicts with class variable", m) - @unittest.expectedFailure # TODO: RUSTPYTHON def test_set_doc(self): class X: "elephant" diff --git a/crates/vm/src/builtins/type.rs b/crates/vm/src/builtins/type.rs index 1cf8119e9c9..cfa08dcf5a6 100644 --- a/crates/vm/src/builtins/type.rs +++ b/crates/vm/src/builtins/type.rs @@ -2004,7 +2004,7 @@ impl Constructor for PyType { // Check if slot name conflicts with class attributes if attributes.contains_key(vm.ctx.intern_str(slot.as_wtf8())) { return Err(vm.new_value_error(format!( - "'{}' in __slots__ conflicts with a class variable", + "'{}' in __slots__ conflicts with class variable", slot.as_wtf8() ))); } @@ -2404,7 +2404,7 @@ impl Py { // Similar to CPython's type_set_doc let value = value.ok_or_else(|| { vm.new_type_error(format!( - "cannot delete '__doc__' attribute of type '{}'", + "cannot delete '__doc__' attribute of immutable type '{}'", self.name() )) })?;