mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-44342: [Enum] fix data type search (GH-26667)
In an inheritance chain of
int -> my_int -> final_int
the data type is now final_int (not my_int)
(cherry picked from commit 3a7cccfd6c
)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
This commit is contained in:
parent
8d0b2ca493
commit
0f99324f61
2 changed files with 9 additions and 1 deletions
|
@ -823,7 +823,7 @@ class EnumType(type):
|
|||
data_types.add(candidate or base)
|
||||
break
|
||||
else:
|
||||
candidate = base
|
||||
candidate = candidate or base
|
||||
if len(data_types) > 1:
|
||||
raise TypeError('%r: too many data types: %r' % (class_name, data_types))
|
||||
elif data_types:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue