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 | daa9756cb6395323d6f291efe5c7d7fdc6b2e9d8 (diff) | |
download | cpython-git-d2ec81a8c99796b51fb8c49b77a7fe369863226f.tar.gz |
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 245f4c0454..0e0c446188 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) |