File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 2424
2525class GenericTests (unittest .TestCase ):
2626
27- # TODO: RUSTPYTHON
28- @unittest .expectedFailure
2927 def test_enums (self ):
3028 for name in dir (signal ):
3129 sig = getattr (signal , name )
Original file line number Diff line number Diff line change @@ -1499,9 +1499,15 @@ impl Constructor for PyType {
14991499 // Only add if:
15001500 // 1. base is not type (type subclasses inherit __dict__ from type)
15011501 // 2. the class has HAS_DICT flag (i.e., __slots__ was not defined or __dict__ is in __slots__)
1502+ // 3. no base class in MRO already provides __dict__ descriptor
15021503 if !base_is_type && typ. slots . flags . has_feature ( PyTypeFlags :: HAS_DICT ) {
15031504 let __dict__ = identifier ! ( vm, __dict__) ;
1504- if !typ. attributes . read ( ) . contains_key ( & __dict__) {
1505+ let has_inherited_dict = typ
1506+ . mro
1507+ . read ( )
1508+ . iter ( )
1509+ . any ( |base| base. attributes . read ( ) . contains_key ( & __dict__) ) ;
1510+ if !typ. attributes . read ( ) . contains_key ( & __dict__) && !has_inherited_dict {
15051511 unsafe {
15061512 let descriptor =
15071513 vm. ctx
You can’t perform that action at this time.
0 commit comments