mirror of
https://github.com/python/cpython.git
synced 2025-07-10 04:45:36 +00:00
bpo-34909: keep searching mixins until base class is found (GH-9737)
This commit is contained in:
parent
92878829c3
commit
cd45385ffa
2 changed files with 22 additions and 3 deletions
|
@ -486,7 +486,7 @@ class EnumMeta(type):
|
|||
if base is object:
|
||||
continue
|
||||
elif '__new__' in base.__dict__:
|
||||
if issubclass(base, Enum) and not hasattr(base, '__new_member__'):
|
||||
if issubclass(base, Enum):
|
||||
continue
|
||||
return base
|
||||
|
||||
|
@ -499,7 +499,6 @@ class EnumMeta(type):
|
|||
member_type = _find_data_type(bases) or object
|
||||
if first_enum._member_names_:
|
||||
raise TypeError("Cannot extend enumerations")
|
||||
|
||||
return member_type, first_enum
|
||||
|
||||
@staticmethod
|
||||
|
@ -545,7 +544,6 @@ class EnumMeta(type):
|
|||
use_args = False
|
||||
else:
|
||||
use_args = True
|
||||
|
||||
return __new__, save_new, use_args
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue