File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -818,7 +818,7 @@ def _find_data_type(bases):
818
818
data_types .add (candidate or base )
819
819
break
820
820
else :
821
- candidate = base
821
+ candidate = candidate or base
822
822
if len (data_types ) > 1 :
823
823
raise TypeError ('%r: too many data types: %r' % (class_name , data_types ))
824
824
elif data_types :
Original file line number Diff line number Diff line change @@ -658,6 +658,14 @@ class MyEnum(HexInt, enum.Enum):
658
658
def __repr__ (self ):
659
659
return '<%s.%s: %r>' % (self .__class__ .__name__ , self ._name_ , self ._value_ )
660
660
self .assertEqual (repr (MyEnum .A ), '<MyEnum.A: 0x1>' )
661
+ #
662
+ class SillyInt (HexInt ):
663
+ pass
664
+ class MyOtherEnum (SillyInt , enum .Enum ):
665
+ D = 4
666
+ E = 5
667
+ F = 6
668
+ self .assertIs (MyOtherEnum ._member_type_ , SillyInt )
661
669
662
670
def test_too_many_data_types (self ):
663
671
with self .assertRaisesRegex (TypeError , 'too many data types' ):
You can’t perform that action at this time.
0 commit comments