Close #18924: Block naive attempts to change an Enum member.
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 2a589f5..018e3fd 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -152,6 +152,11 @@
with self.assertRaises(AttributeError):
Season.SPRING.value = 2
+ def test_changing_member(self):
+ Season = self.Season
+ with self.assertRaises(AttributeError):
+ Season.WINTER = 'really cold'
+
def test_invalid_names(self):
with self.assertRaises(ValueError):
class Wrong(Enum):