summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-04-30 12:06:49 (GMT)
committerGitHub <noreply@github.com>2021-04-30 12:06:49 (GMT)
commit0cad068ec174bbe33fb80460da56eb413f3b9359 (patch)
tree530294e1078c5da834364b5d8f2637bbb4fc28f7 /Lib
parent3bb09947ec4837de75532e21dd4bd25db0a1f1b7 (diff)
downloadcpython-0cad068ec174bbe33fb80460da56eb413f3b9359.zip
cpython-0cad068ec174bbe33fb80460da56eb413f3b9359.tar.gz
cpython-0cad068ec174bbe33fb80460da56eb413f3b9359.tar.bz2
bpo-43916: Remove _disabled_new() function (GH-25745)
posix and _hashlib use the new Py_TPFLAGS_DISALLOW_INSTANTIATION flag on their heap types, rather than using a custom tp_new function (_disabled_new).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_hashlib.py4
-rw-r--r--Lib/test/test_hmac.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 9e9c874..1236aa7 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -905,11 +905,11 @@ class HashLibTestCase(unittest.TestCase):
def test_internal_types(self):
# internal types like _hashlib.HASH are not constructable
with self.assertRaisesRegex(
- TypeError, "cannot create 'HASH' instance"
+ TypeError, "cannot create '_hashlib.HASH' instance"
):
HASH()
with self.assertRaisesRegex(
- TypeError, "cannot create 'HASHXOF' instance"
+ TypeError, "cannot create '_hashlib.HASHXOF' instance"
):
HASHXOF()
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index adf52ad..22d74e9 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -440,7 +440,7 @@ class ConstructorTestCase(unittest.TestCase):
def test_internal_types(self):
# internal types like _hashlib.C_HMAC are not constructable
with self.assertRaisesRegex(
- TypeError, "cannot create 'HMAC' instance"
+ TypeError, "cannot create '_hashlib.HMAC' instance"
):
C_HMAC()