bpo-41517: do not allow Enums to be extended (#22271)
fix bug that let Enums be extended via multiple inheritance
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 865edf1..2fcd047 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -1009,6 +1009,9 @@
cyan = 4
magenta = 5
yellow = 6
+ with self.assertRaisesRegex(TypeError, "EvenMoreColor: cannot extend enumeration 'Color'"):
+ class EvenMoreColor(Color, IntEnum):
+ chartruese = 7
def test_exclude_methods(self):
class whatever(Enum):