[Python-checkins] gh-93118: [Enum] fix error message (GH-93138)
ethanfurman
webhook-mailer at python.org
Mon May 23 14:22:03 EDT 2022
https://github.com/python/cpython/commit/a49721ea075a18a7787ace6752b4eb0954e1b607
commit: a49721ea075a18a7787ace6752b4eb0954e1b607
branch: main
author: Ethan Furman <ethan at stoneleaf.us>
committer: ethanfurman <ethan at stoneleaf.us>
date: 2022-05-23T11:21:58-07:00
summary:
gh-93118: [Enum] fix error message (GH-93138)
Include member names in error message.
files:
M Lib/enum.py
diff --git a/Lib/enum.py b/Lib/enum.py
index 62fd5ce8fb9a0..64b44197df522 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -480,8 +480,9 @@ def __new__(metacls, cls, bases, classdict, *, boundary=None, _simple=False, **k
# 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)
More information about the Python-checkins
mailing list