diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2020-09-16 14:11:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 14:11:57 (GMT) |
commit | 3064dbf5df1021e85b507366a7ea448c8895efe7 (patch) | |
tree | e1b846f6d233d1358de877d62a1888580dee1ed7 /Lib/test/test_enum.py | |
parent | 0705ec8a149e27023b0420ae0366d16255f6c9f7 (diff) | |
download | cpython-3064dbf5df1021e85b507366a7ea448c8895efe7.zip cpython-3064dbf5df1021e85b507366a7ea448c8895efe7.tar.gz cpython-3064dbf5df1021e85b507366a7ea448c8895efe7.tar.bz2 |
bpo-41517: do not allow Enums to be extended (#22271)
fix bug that let Enums be extended via multiple inheritance
Diffstat (limited to 'Lib/test/test_enum.py')
-rw-r--r-- | Lib/test/test_enum.py | 3 |
1 files changed, 3 insertions, 0 deletions
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 @@ class TestEnum(unittest.TestCase): 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): |