summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-06-15 21:07:37 (GMT)
committerGitHub <noreply@github.com>2021-06-15 21:07:37 (GMT)
commit0f99324f61d5a2edd8729be5eed6f172c892af24 (patch)
tree052d74749f3fd58e19d32e198b69e556cf2368dd /Lib/enum.py
parent8d0b2ca493e236fcad8709a622c1ac8ad29c372d (diff)
downloadcpython-0f99324f61d5a2edd8729be5eed6f172c892af24.zip
cpython-0f99324f61d5a2edd8729be5eed6f172c892af24.tar.gz
cpython-0f99324f61d5a2edd8729be5eed6f172c892af24.tar.bz2
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 3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa) Co-authored-by: Ethan Furman <ethan@stoneleaf.us> Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 9f9c89e..49c46ea 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -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: