Skip to content

Commit a49721e

Browse files
authored
gh-93118: [Enum] fix error message (GH-93138)
Include member names in error message.
1 parent 202ed25 commit a49721e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/enum.py

Lines changed: 3 additions & 2 deletions
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)