mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
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).
This commit is contained in:
parent
4a31ed8a32
commit
08cfc3dabf
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue