diff options
author | Victor Stinner <vstinner@python.org> | 2021-04-30 16:40:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-30 16:40:30 (GMT) |
commit | 665c7746fca180266b121183c2d5136c547006e0 (patch) | |
tree | 208fbd2a6ac0b7bf001fd3fb09ac36884f967215 /Modules/sha512module.c | |
parent | e374a40afa09be728b01653a06c9febfad9c9c50 (diff) | |
download | cpython-665c7746fca180266b121183c2d5136c547006e0.zip cpython-665c7746fca180266b121183c2d5136c547006e0.tar.gz cpython-665c7746fca180266b121183c2d5136c547006e0.tar.bz2 |
bpo-43916: _md5.md5 uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25753)
The following types use Py_TPFLAGS_DISALLOW_INSTANTIATION flag:
* _md5.md5
* _sha1.sha1
* _sha256.sha224
* _sha256.sha256
* _sha512.sha384
* _sha512.sha512
Diffstat (limited to 'Modules/sha512module.c')
-rw-r--r-- | Modules/sha512module.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/sha512module.c b/Modules/sha512module.c index 0d8f51e..5e8572c 100644 --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -602,7 +602,7 @@ static PyType_Slot sha512_sha384_type_slots[] = { static PyType_Spec sha512_sha384_type_spec = { .name = "_sha512.sha384", .basicsize = sizeof(SHAobject), - .flags = Py_TPFLAGS_DEFAULT, + .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION, .slots = sha512_sha384_type_slots }; @@ -619,7 +619,7 @@ static PyType_Slot sha512_sha512_type_slots[] = { static PyType_Spec sha512_sha512_type_spec = { .name = "_sha512.sha512", .basicsize = sizeof(SHAobject), - .flags = Py_TPFLAGS_DEFAULT, + .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION, .slots = sha512_sha512_type_slots }; |