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).
This commit is contained in:
Victor Stinner 2021-04-30 14:06:49 +02:00 committed by GitHub
parent 3bb09947ec
commit 0cad068ec1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 30 deletions

View file

@ -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()