summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2022-05-23 18:21:58 (GMT)
committerGitHub <noreply@github.com>2022-05-23 18:21:58 (GMT)
commita49721ea075a18a7787ace6752b4eb0954e1b607 (patch)
tree7f88698fb6d11da03bba50de30dba8597020e7a9 /Lib/enum.py
parent202ed2506c84cd98e9e35621b5b2929ceb717864 (diff)
downloadcpython-a49721ea075a18a7787ace6752b4eb0954e1b607.zip
cpython-a49721ea075a18a7787ace6752b4eb0954e1b607.tar.gz
cpython-a49721ea075a18a7787ace6752b4eb0954e1b607.tar.bz2
gh-93118: [Enum] fix error message (GH-93138)
Include member names in error message.
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 62fd5ce..64b4419 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)