diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c index 8c28249d561c08..7f8ea44bc5fd63 100644 --- a/Modules/_blake2/blake2b_impl.c +++ b/Modules/_blake2/blake2b_impl.c @@ -407,6 +407,8 @@ static PyType_Slot blake2b_type_slots[] = { {0,0} }; +// Using PyType_GetModuleState() on this type is safe since +// it cannot be subclassed: it does not have the Py_TPFLAGS_BASETYPE flag. PyType_Spec blake2b_type_spec = { .name = "_blake2.blake2b", .basicsize = sizeof(BLAKE2bObject), diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c index e4146997da33d4..ffaf4315133061 100644 --- a/Modules/_blake2/blake2s_impl.c +++ b/Modules/_blake2/blake2s_impl.c @@ -406,6 +406,8 @@ static PyType_Slot blake2s_type_slots[] = { {0,0} }; +// Using PyType_GetModuleState() on this type is safe since +// it cannot be subclassed: it does not have the Py_TPFLAGS_BASETYPE flag. PyType_Spec blake2s_type_spec = { .name = "_blake2.blake2s", .basicsize = sizeof(BLAKE2sObject),