Skip to content

Commit 6179261

Browse files
committed
raise an ImportError when failing to fetch OpenSSL HMAC
1 parent f1127a1 commit 6179261

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/_hashopenssl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2652,7 +2652,8 @@ hashlib_init_hmactype(PyObject *module)
26522652
#ifdef Py_HAS_OPENSSL3_SUPPORT
26532653
state->evp_hmac = EVP_MAC_fetch(NULL, "HMAC", NULL);
26542654
if (state->evp_hmac == NULL) {
2655-
raise_ssl_error(PyExc_ImportError, "cannot initialize EVP_MAC HMAC");
2655+
ERR_clear_error();
2656+
PyErr_SetString(PyExc_ImportError, "cannot initialize EVP_MAC HMAC");
26562657
return -1;
26572658
}
26582659
#endif

0 commit comments

Comments
 (0)