summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 1efddfa..7ad599b 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -430,7 +430,9 @@ class _EnumDict(dict):
if isinstance(value, auto):
single = True
value = (value, )
- if isinstance(value, tuple):
+ if type(value) is tuple and any(isinstance(v, auto) for v in value):
+ # insist on an actual tuple, no subclasses, in keeping with only supporting
+ # top-level auto() usage (not contained in any other data structure)
auto_valued = []
for v in value:
if isinstance(v, auto):