|
23 | 23 | #include "Python.h"
|
24 | 24 | #include "pycore_bitutils.h" // _Py_bswap32()
|
25 | 25 | #include "pycore_moduleobject.h" // _PyModule_GetState()
|
| 26 | +#include "pycore_typeobject.h" // _PyType_GetModuleState() |
26 | 27 | #include "pycore_strhex.h" // _Py_strhex()
|
27 | 28 | #include "structmember.h" // PyMemberDef
|
28 | 29 | #include "hashlib.h"
|
@@ -217,7 +218,7 @@ SHA256Type_copy_impl(SHA256object *self, PyTypeObject *cls)
|
217 | 218 | /*[clinic end generated code: output=fabd515577805cd3 input=3137146fcb88e212]*/
|
218 | 219 | {
|
219 | 220 | SHA256object *newobj;
|
220 |
| - sha2_state *state = PyType_GetModuleState(cls); |
| 221 | + sha2_state *state = _PyType_GetModuleState(cls); |
221 | 222 | if (Py_IS_TYPE(self, state->sha256_type)) {
|
222 | 223 | if ((newobj = newSHA256object(state)) == NULL) {
|
223 | 224 | return NULL;
|
@@ -245,7 +246,7 @@ SHA512Type_copy_impl(SHA512object *self, PyTypeObject *cls)
|
245 | 246 | /*[clinic end generated code: output=66d2a8ef20de8302 input=f673a18f66527c90]*/
|
246 | 247 | {
|
247 | 248 | SHA512object *newobj;
|
248 |
| - sha2_state *state = PyType_GetModuleState(cls); |
| 249 | + sha2_state *state = _PyType_GetModuleState(cls); |
249 | 250 |
|
250 | 251 | if (Py_IS_TYPE((PyObject*)self, state->sha512_type)) {
|
251 | 252 | if ((newobj = newSHA512object(state)) == NULL) {
|
@@ -482,7 +483,7 @@ static PyType_Slot sha512_type_slots[] = {
|
482 | 483 | {0,0}
|
483 | 484 | };
|
484 | 485 |
|
485 |
| -// Using PyType_GetModuleState() on these types is safe since they |
| 486 | +// Using _PyType_GetModuleState() on these types is safe since they |
486 | 487 | // cannot be subclassed: they don't have the Py_TPFLAGS_BASETYPE flag.
|
487 | 488 | static PyType_Spec sha224_type_spec = {
|
488 | 489 | .name = "_sha2.SHA224Type",
|
|
0 commit comments