bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792)
Signed-off-by: Christian Heimes <christian@python.org>
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index 22d74e9..964acd0 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -444,6 +444,9 @@ def test_internal_types(self):
):
C_HMAC()
+ with self.assertRaisesRegex(TypeError, "immutable type"):
+ C_HMAC.value = None
+
@unittest.skipUnless(sha256_module is not None, 'need _sha256')
def test_with_sha256_module(self):
h = hmac.HMAC(b"key", b"hash this!", digestmod=sha256_module.sha256)