Skip to content

Commit d36aeda

Browse files
committed
minor fixes
1 parent 837c211 commit d36aeda

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/enum.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ def _check_for_existing_members_(mcls, class_name, bases):
961961
)
962962

963963
@classmethod
964-
def _get_mixins_(cls, class_name, bases):
964+
def _get_mixins_(mcls, class_name, bases):
965965
"""
966966
Returns the type for creating enum members, and the first inherited
967967
enum class.
@@ -979,8 +979,7 @@ def _get_mixins_(cls, class_name, bases):
979979
if not issubclass(first_enum, Enum):
980980
raise TypeError("new enumerations should be created as "
981981
"`EnumName([mixin_type, ...] [data_type,] enum_type)`")
982-
cls._check_for_existing_members(class_name, bases)
983-
member_type = _find_data_type(bases) or object
982+
member_type = mcls._find_data_type_(class_name, bases) or object
984983
return member_type, first_enum
985984

986985
@classmethod

Lib/test/test_enum.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,8 @@ class MoreColor(Color):
12381238
with self.assertRaisesRegex(TypeError, "<enum .EvenMoreColor.> cannot extend <enum .Color.>"):
12391239
class EvenMoreColor(Color, IntEnum):
12401240
chartruese = 7
1241-
with self.assertRaisesRegex(TypeError, "Foo: cannot extend enumeration 'Color'"):
1241+
#
1242+
with self.assertRaisesRegex(TypeError, "<enum .Foo.> cannot extend <enum .Color.>"):
12421243
Color('Foo', ('pink', 'black'))
12431244

12441245
def test_exclude_methods(self):

0 commit comments

Comments
 (0)