summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2017-06-21 16:52:32 (GMT)
committerethanfurman <ethan@stoneleaf.us>2017-06-21 16:52:32 (GMT)
commitdcc8ce44c74492670e6bfbde588a2acbf8f365e0 (patch)
tree911ffe701c25f1be9beeeeae22f924516a95e025 /Lib/enum.py
parent5ff7132313eb651107b179d20218dfe5d4e47f13 (diff)
downloadcpython-dcc8ce44c74492670e6bfbde588a2acbf8f365e0.zip
cpython-dcc8ce44c74492670e6bfbde588a2acbf8f365e0.tar.gz
cpython-dcc8ce44c74492670e6bfbde588a2acbf8f365e0.tar.bz2
bpo-30616: Functional API of enum allows to create empty enums. (#2304)
* bpo-30616: Functional API of enum allows to create empty enums. * Update NEWS move addition to avoid conflict
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 056400d..73dd613 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -381,7 +381,7 @@ class EnumMeta(type):
# special processing needed for names?
if isinstance(names, str):
names = names.replace(',', ' ').split()
- if isinstance(names, (tuple, list)) and isinstance(names[0], str):
+ if isinstance(names, (tuple, list)) and names and isinstance(names[0], str):
original_names, names = names, []
last_values = []
for count, name in enumerate(original_names):