mirror of
https://github.com/python/cpython.git
synced 2025-10-23 15:12:02 +00:00
Silence a compiler warning about an unused function
This commit is contained in:
parent
79f5e1f59a
commit
2be28a6984
1 changed files with 28 additions and 28 deletions
|
@ -63,34 +63,6 @@ DEFINE_CONSTS_FOR_NEW(sha384)
|
||||||
DEFINE_CONSTS_FOR_NEW(sha512)
|
DEFINE_CONSTS_FOR_NEW(sha512)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
_setException(PyObject *exc)
|
|
||||||
{
|
|
||||||
unsigned long errcode;
|
|
||||||
const char *lib, *func, *reason;
|
|
||||||
|
|
||||||
errcode = ERR_peek_last_error();
|
|
||||||
if (!errcode) {
|
|
||||||
PyErr_SetString(exc, "unknown reasons");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
ERR_clear_error();
|
|
||||||
|
|
||||||
lib = ERR_lib_error_string(errcode);
|
|
||||||
func = ERR_func_error_string(errcode);
|
|
||||||
reason = ERR_reason_error_string(errcode);
|
|
||||||
|
|
||||||
if (lib && func) {
|
|
||||||
PyErr_Format(exc, "[%s: %s] %s", lib, func, reason);
|
|
||||||
}
|
|
||||||
else if (lib) {
|
|
||||||
PyErr_Format(exc, "[%s] %s", lib, reason);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
PyErr_SetString(exc, reason);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static EVPobject *
|
static EVPobject *
|
||||||
newEVPobject(PyObject *name)
|
newEVPobject(PyObject *name)
|
||||||
|
@ -588,6 +560,34 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass, int passlen,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *
|
||||||
|
_setException(PyObject *exc)
|
||||||
|
{
|
||||||
|
unsigned long errcode;
|
||||||
|
const char *lib, *func, *reason;
|
||||||
|
|
||||||
|
errcode = ERR_peek_last_error();
|
||||||
|
if (!errcode) {
|
||||||
|
PyErr_SetString(exc, "unknown reasons");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
ERR_clear_error();
|
||||||
|
|
||||||
|
lib = ERR_lib_error_string(errcode);
|
||||||
|
func = ERR_func_error_string(errcode);
|
||||||
|
reason = ERR_reason_error_string(errcode);
|
||||||
|
|
||||||
|
if (lib && func) {
|
||||||
|
PyErr_Format(exc, "[%s: %s] %s", lib, func, reason);
|
||||||
|
}
|
||||||
|
else if (lib) {
|
||||||
|
PyErr_Format(exc, "[%s] %s", lib, reason);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
PyErr_SetString(exc, reason);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(pbkdf2_hmac__doc__,
|
PyDoc_STRVAR(pbkdf2_hmac__doc__,
|
||||||
"pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> key\n\
|
"pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> key\n\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue