Bug report
It does it in some parts:
|
if (PyModule_AddType(m, st->blake2b_type) < 0) { |
|
return -1; |
|
} |
|
#define ADD_INT(d, name, value) do { \ |
|
PyObject *x = PyLong_FromLong(value); \ |
|
if (!x) \ |
|
return -1; \ |
|
if (PyDict_SetItemString(d, name, x) < 0) { \ |
|
Py_DECREF(x); \ |
|
return -1; \ |
|
} \ |
|
Py_DECREF(x); \ |
|
} while(0) |
But, not in others:
|
PyModule_AddIntConstant(m, "BLAKE2B_SALT_SIZE", BLAKE2B_SALTBYTES); |
|
PyModule_AddIntConstant(m, "BLAKE2B_PERSON_SIZE", BLAKE2B_PERSONALBYTES); |
|
PyModule_AddIntConstant(m, "BLAKE2B_MAX_KEY_SIZE", BLAKE2B_KEYBYTES); |
|
PyModule_AddIntConstant(m, "BLAKE2B_MAX_DIGEST_SIZE", BLAKE2B_OUTBYTES); |
|
PyModule_AddIntConstant(m, "BLAKE2S_SALT_SIZE", BLAKE2S_SALTBYTES); |
|
PyModule_AddIntConstant(m, "BLAKE2S_PERSON_SIZE", BLAKE2S_PERSONALBYTES); |
|
PyModule_AddIntConstant(m, "BLAKE2S_MAX_KEY_SIZE", BLAKE2S_KEYBYTES); |
|
PyModule_AddIntConstant(m, "BLAKE2S_MAX_DIGEST_SIZE", BLAKE2S_OUTBYTES); |
This is similar to:
Linked PRs
Bug report
It does it in some parts:
cpython/Modules/_blake2/blake2module.c
Lines 88 to 90 in 81eba76
cpython/Modules/_blake2/blake2module.c
Lines 66 to 75 in 81eba76
But, not in others:
cpython/Modules/_blake2/blake2module.c
Lines 98 to 101 in 81eba76
cpython/Modules/_blake2/blake2module.c
Lines 120 to 123 in 81eba76
This is similar to:
_selectmodule.cdoes not handle errors when creating a module #111233_ssl.cdoes not handle errors on module creation #111230Linked PRs