Skip to content

Commit b8c4cc6

Browse files
gh-93118: [Enum] fix error message (GH-93138) (GH-93142)
Include member names in error message. (cherry picked from commit a49721e)
1 parent cea6573 commit b8c4cc6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/enum.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,9 @@ def __new__(metacls, cls, bases, classdict, *, boundary=None, _simple=False, **k
480480
# check for illegal enum names (any others?)
481481
invalid_names = set(member_names) & {'mro', ''}
482482
if invalid_names:
483-
raise ValueError('invalid enum member name(s) '.format(
484-
','.join(repr(n) for n in invalid_names)))
483+
raise ValueError('invalid enum member name(s) %s' % (
484+
','.join(repr(n) for n in invalid_names)
485+
))
485486
#
486487
# adjust the sunders
487488
_order_ = classdict.pop('_order_', None)

0 commit comments

Comments
 (0)