From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 23 May 2022 21:37:18 +0000 (-0700) Subject: gh-93118: [Enum] fix error message (GH-93138) (GH-93142) X-Git-Tag: v3.11.0b2~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8c4cc6b76bde5371baee18c76146b86adb81dbb;p=thirdparty%2FPython%2Fcpython.git gh-93118: [Enum] fix error message (GH-93138) (GH-93142) Include member names in error message. (cherry picked from commit a49721ea075a18a7787ace6752b4eb0954e1b607) --- diff --git a/Lib/enum.py b/Lib/enum.py index 43cd1bc2b1e3..31923d757f80 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)