]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-93118: [Enum] fix error message (GH-93138)
authorEthan Furman <ethan@stoneleaf.us>
Mon, 23 May 2022 18:21:58 +0000 (11:21 -0700)
committerGitHub <noreply@github.com>
Mon, 23 May 2022 18:21:58 +0000 (11:21 -0700)
Include member names in error message.

Lib/enum.py

index 62fd5ce8fb9a080c97ac38ccab0132f3fe4669f2..64b44197df522df9ce11250e8b1f7872b4fb30e2 100644 (file)
@@ -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)