mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
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:
parent
3bb09947ec
commit
0cad068ec1
4 changed files with 9 additions and 30 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue