summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2021-06-11 08:25:14 (GMT)
committerGitHub <noreply@github.com>2021-06-11 08:25:14 (GMT)
commit3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa (patch)
tree257abc455855a84ecc862bbd1986e3183598a7f5 /Lib/enum.py
parente26014f1c47d26d6097ff7a0f25384bfbde714a9 (diff)
downloadcpython-3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa.zip
cpython-3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa.tar.gz
cpython-3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa.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)
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 5263e51..5548130 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -818,7 +818,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: