diff options
author | Victor Stinner <vstinner@python.org> | 2020-02-07 09:17:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 09:17:07 +0100 |
commit | d2ec81a8c99796b51fb8c49b77a7fe369863226f (patch) | |
tree | d88e7cbe89f65366d5591338fbe59a71192950db /Modules/sha256module.c | |
parent | bpo-39573: Use Py_TYPE() macro in Modules directory (GH-18393) (diff) | |
download | cpython-d2ec81a8c99796b51fb8c49b77a7fe369863226f.tar.gz cpython-d2ec81a8c99796b51fb8c49b77a7fe369863226f.tar.bz2 cpython-d2ec81a8c99796b51fb8c49b77a7fe369863226f.zip |
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
Diffstat (limited to 'Modules/sha256module.c')
-rw-r--r-- | Modules/sha256module.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/sha256module.c b/Modules/sha256module.c index 245f4c04542..0e0c4461880 100644 --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -713,12 +713,14 @@ PyInit__sha256(void) { PyObject *m; - Py_TYPE(&SHA224type) = &PyType_Type; - if (PyType_Ready(&SHA224type) < 0) + Py_SET_TYPE(&SHA224type, &PyType_Type); + if (PyType_Ready(&SHA224type) < 0) { return NULL; - Py_TYPE(&SHA256type) = &PyType_Type; - if (PyType_Ready(&SHA256type) < 0) + } + Py_SET_TYPE(&SHA256type, &PyType_Type); + if (PyType_Ready(&SHA256type) < 0) { return NULL; + } m = PyModule_Create(&_sha256module); if (m == NULL) |