summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorTobin Yehle <tobinyehle@gmail.com>2022-05-25 01:16:20 (GMT)
committerGitHub <noreply@github.com>2022-05-25 01:16:20 (GMT)
commit08cfc3dabf0f81a4494cd0d697befc7d0dec77b7 (patch)
treee4930c454df936dfc2b4510846c547356aa20e78 /Lib/enum.py
parent4a31ed8a32699973ae1f779022794fdab9fa08ee (diff)
downloadcpython-08cfc3dabf0f81a4494cd0d697befc7d0dec77b7.zip
cpython-08cfc3dabf0f81a4494cd0d697befc7d0dec77b7.tar.gz
cpython-08cfc3dabf0f81a4494cd0d697befc7d0dec77b7.tar.bz2
gh-93035: [Enum] Fix IntFlag crash when no single-bit members (GH-93076)
`EnumType` attempts to create a custom docstring for each enum/flag, but that was failing with pathological flags that had no members (only multi-bit aliases).
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 64b4419..0b97d3d 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -538,7 +538,7 @@ class EnumType(type):
#
# create a default docstring if one has not been provided
if enum_class.__doc__ is None:
- if not member_names:
+ if not member_names or not list(enum_class):
enum_class.__doc__ = classdict['__doc__'] = _dedent("""\
Create a collection of name/value pairs.