Skip to content

Commit 4372011

Browse files
authored
gh-134531: fix _hashlib clinic directive post GH-134626 (#135249)
1 parent bcb6b45 commit 4372011

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Modules/_hashopenssl.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static PyModuleDef _hashlibmodule;
260260

261261
typedef struct {
262262
PyTypeObject *HASH_type; // based on EVP_MD
263-
PyTypeObject *HMACtype;
263+
PyTypeObject *HMAC_type;
264264
#ifdef PY_OPENSSL_HAS_SHAKE
265265
PyTypeObject *HASHXOF_type; // based on EVP_MD
266266
#endif
@@ -300,11 +300,11 @@ typedef struct {
300300
#include "clinic/_hashopenssl.c.h"
301301
/*[clinic input]
302302
module _hashlib
303-
class _hashlib.HASH "HASHobject *" "((_hashlibstate *)PyModule_GetState(module))->EVPtype"
304-
class _hashlib.HASHXOF "HASHobject *" "((_hashlibstate *)PyModule_GetState(module))->EVPXOFtype"
305-
class _hashlib.HMAC "HMACobject *" "((_hashlibstate *)PyModule_GetState(module))->HMACtype"
303+
class _hashlib.HASH "HASHobject *" "((_hashlibstate *)PyModule_GetState(module))->HASH_type"
304+
class _hashlib.HASHXOF "HASHobject *" "((_hashlibstate *)PyModule_GetState(module))->HASHXOF_type"
305+
class _hashlib.HMAC "HMACobject *" "((_hashlibstate *)PyModule_GetState(module))->HMAC_type"
306306
[clinic start generated code]*/
307-
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=4f6b8873ed13d1ff]*/
307+
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=eb805ce4b90b1b31]*/
308308

309309

310310
/* LCOV_EXCL_START */
@@ -1643,7 +1643,7 @@ _hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj,
16431643
}
16441644

16451645
_hashlibstate *state = get_hashlib_state(module);
1646-
self = PyObject_New(HMACobject, state->HMACtype);
1646+
self = PyObject_New(HMACobject, state->HMAC_type);
16471647
if (self == NULL) {
16481648
goto error;
16491649
}
@@ -2204,7 +2204,7 @@ hashlib_traverse(PyObject *m, visitproc visit, void *arg)
22042204
{
22052205
_hashlibstate *state = get_hashlib_state(m);
22062206
Py_VISIT(state->HASH_type);
2207-
Py_VISIT(state->HMACtype);
2207+
Py_VISIT(state->HMAC_type);
22082208
#ifdef PY_OPENSSL_HAS_SHAKE
22092209
Py_VISIT(state->HASHXOF_type);
22102210
#endif
@@ -2218,7 +2218,7 @@ hashlib_clear(PyObject *m)
22182218
{
22192219
_hashlibstate *state = get_hashlib_state(m);
22202220
Py_CLEAR(state->HASH_type);
2221-
Py_CLEAR(state->HMACtype);
2221+
Py_CLEAR(state->HMAC_type);
22222222
#ifdef PY_OPENSSL_HAS_SHAKE
22232223
Py_CLEAR(state->HASHXOF_type);
22242224
#endif
@@ -2296,11 +2296,11 @@ hashlib_init_hmactype(PyObject *module)
22962296
{
22972297
_hashlibstate *state = get_hashlib_state(module);
22982298

2299-
state->HMACtype = (PyTypeObject *)PyType_FromSpec(&HMACtype_spec);
2300-
if (state->HMACtype == NULL) {
2299+
state->HMAC_type = (PyTypeObject *)PyType_FromSpec(&HMACtype_spec);
2300+
if (state->HMAC_type == NULL) {
23012301
return -1;
23022302
}
2303-
if (PyModule_AddType(module, state->HMACtype) < 0) {
2303+
if (PyModule_AddType(module, state->HMAC_type) < 0) {
23042304
return -1;
23052305
}
23062306
return 0;

0 commit comments

Comments
 (0)