mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
gh-93118: [Enum] fix error message (GH-93138)
Include member names in error message.
This commit is contained in:
parent
202ed2506c
commit
a49721ea07
1 changed files with 3 additions and 2 deletions
|
|
@ -480,8 +480,9 @@ class EnumType(type):
|
|||
# check for illegal enum names (any others?)
|
||||
invalid_names = set(member_names) & {'mro', ''}
|
||||
if invalid_names:
|
||||
raise ValueError('invalid enum member name(s) '.format(
|
||||
','.join(repr(n) for n in invalid_names)))
|
||||
raise ValueError('invalid enum member name(s) %s' % (
|
||||
','.join(repr(n) for n in invalid_names)
|
||||
))
|
||||
#
|
||||
# adjust the sunders
|
||||
_order_ = classdict.pop('_order_', None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue