From b8c4cc6b76bde5371baee18c76146b86adb81dbb Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 23 May 2022 14:37:18 -0700 Subject: gh-93118: [Enum] fix error message (GH-93138) (GH-93142) Include member names in error message. (cherry picked from commit a49721ea075a18a7787ace6752b4eb0954e1b607) --- Lib/enum.py | 5 +++-- 1 file 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) -- cgit v0.12