mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
This commit is contained in:
parent
daa9756cb6
commit
d2ec81a8c9
24 changed files with 77 additions and 48 deletions
|
@ -62,7 +62,7 @@ PyInit__blake2(void)
|
|||
return NULL;
|
||||
|
||||
/* BLAKE2b */
|
||||
Py_TYPE(&PyBlake2_BLAKE2bType) = &PyType_Type;
|
||||
Py_SET_TYPE(&PyBlake2_BLAKE2bType, &PyType_Type);
|
||||
if (PyType_Ready(&PyBlake2_BLAKE2bType) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ PyInit__blake2(void)
|
|||
PyModule_AddIntConstant(m, "BLAKE2B_MAX_DIGEST_SIZE", BLAKE2B_OUTBYTES);
|
||||
|
||||
/* BLAKE2s */
|
||||
Py_TYPE(&PyBlake2_BLAKE2sType) = &PyType_Type;
|
||||
Py_SET_TYPE(&PyBlake2_BLAKE2sType, &PyType_Type);
|
||||
if (PyType_Ready(&PyBlake2_BLAKE2sType) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue