diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-05-23 21:37:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 21:37:18 (GMT) |
commit | b8c4cc6b76bde5371baee18c76146b86adb81dbb (patch) | |
tree | 5cc77d38424f5b7e3e2f811b5d529f8d8c59d3de /Lib/enum.py | |
parent | cea65730a75c06a34d00ffb29704cc7ac1a56b4b (diff) | |
download | cpython-b8c4cc6b76bde5371baee18c76146b86adb81dbb.zip cpython-b8c4cc6b76bde5371baee18c76146b86adb81dbb.tar.gz cpython-b8c4cc6b76bde5371baee18c76146b86adb81dbb.tar.bz2 |
gh-93118: [Enum] fix error message (GH-93138) (GH-93142)
Include member names in error message.
(cherry picked from commit a49721ea075a18a7787ace6752b4eb0954e1b607)
Diffstat (limited to 'Lib/enum.py')
-rw-r--r-- | Lib/enum.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/enum.py b/Lib/enum.py index 43cd1bc..31923d7 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -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) |