File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -197,8 +197,6 @@ def f(o):
197
197
with self .assertRaises (TypeError ):
198
198
f (o )
199
199
200
- # TODO: RUSTPYTHON
201
- @unittest .expectedFailure
202
200
def test_store_shadowing_slot_should_raise_type_error (self ):
203
201
class Class :
204
202
__slots__ = ("slot" ,)
Original file line number Diff line number Diff line change @@ -274,6 +274,16 @@ impl PyMemberDescriptor {
274
274
vm : & VirtualMachine ,
275
275
) -> PyResult < ( ) > {
276
276
let zelf = Self :: _as_pyref ( zelf, vm) ?;
277
+
278
+ if !obj. class ( ) . fast_issubclass ( & zelf. common . typ ) {
279
+ return Err ( vm. new_type_error ( format ! (
280
+ "descriptor '{}' for '{}' objects doesn't apply to a '{}' object" ,
281
+ zelf. common. name,
282
+ zelf. common. typ. name( ) ,
283
+ obj. class( ) . name( )
284
+ ) ) ) ;
285
+ }
286
+
277
287
zelf. member . set ( obj, value, vm)
278
288
}
279
289
}
You can’t perform that action at this time.
0 commit comments