https://github.com/python/cpython/commit/4372011928b43d369be727ed3eb6d9d4f9610660
commit: 4372011928b43d369be727ed3eb6d9d4f9610660
branch: main
author: Bénédikt Tran <[email protected]>
committer: picnixz <[email protected]>
date: 2025-06-08T07:43:32Z
summary:

gh-134531: fix `_hashlib` clinic directive post GH-134626 (#135249)

files:
M Modules/_hashopenssl.c

diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index 331275076d7937..42821ebe9f6a54 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -260,7 +260,7 @@ static PyModuleDef _hashlibmodule;
 
 typedef struct {
     PyTypeObject *HASH_type;    // based on EVP_MD
-    PyTypeObject *HMACtype;
+    PyTypeObject *HMAC_type;
 #ifdef PY_OPENSSL_HAS_SHAKE
     PyTypeObject *HASHXOF_type; // based on EVP_MD
 #endif
@@ -300,11 +300,11 @@ typedef struct {
 #include "clinic/_hashopenssl.c.h"
 /*[clinic input]
 module _hashlib
-class _hashlib.HASH "HASHobject *" "((_hashlibstate 
*)PyModule_GetState(module))->EVPtype"
-class _hashlib.HASHXOF "HASHobject *" "((_hashlibstate 
*)PyModule_GetState(module))->EVPXOFtype"
-class _hashlib.HMAC "HMACobject *" "((_hashlibstate 
*)PyModule_GetState(module))->HMACtype"
+class _hashlib.HASH "HASHobject *" "((_hashlibstate 
*)PyModule_GetState(module))->HASH_type"
+class _hashlib.HASHXOF "HASHobject *" "((_hashlibstate 
*)PyModule_GetState(module))->HASHXOF_type"
+class _hashlib.HMAC "HMACobject *" "((_hashlibstate 
*)PyModule_GetState(module))->HMAC_type"
 [clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=4f6b8873ed13d1ff]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=eb805ce4b90b1b31]*/
 
 
 /* LCOV_EXCL_START */
@@ -1643,7 +1643,7 @@ _hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, 
PyObject *msg_obj,
     }
 
     _hashlibstate *state = get_hashlib_state(module);
-    self = PyObject_New(HMACobject, state->HMACtype);
+    self = PyObject_New(HMACobject, state->HMAC_type);
     if (self == NULL) {
         goto error;
     }
@@ -2204,7 +2204,7 @@ hashlib_traverse(PyObject *m, visitproc visit, void *arg)
 {
     _hashlibstate *state = get_hashlib_state(m);
     Py_VISIT(state->HASH_type);
-    Py_VISIT(state->HMACtype);
+    Py_VISIT(state->HMAC_type);
 #ifdef PY_OPENSSL_HAS_SHAKE
     Py_VISIT(state->HASHXOF_type);
 #endif
@@ -2218,7 +2218,7 @@ hashlib_clear(PyObject *m)
 {
     _hashlibstate *state = get_hashlib_state(m);
     Py_CLEAR(state->HASH_type);
-    Py_CLEAR(state->HMACtype);
+    Py_CLEAR(state->HMAC_type);
 #ifdef PY_OPENSSL_HAS_SHAKE
     Py_CLEAR(state->HASHXOF_type);
 #endif
@@ -2296,11 +2296,11 @@ hashlib_init_hmactype(PyObject *module)
 {
     _hashlibstate *state = get_hashlib_state(module);
 
-    state->HMACtype = (PyTypeObject *)PyType_FromSpec(&HMACtype_spec);
-    if (state->HMACtype == NULL) {
+    state->HMAC_type = (PyTypeObject *)PyType_FromSpec(&HMACtype_spec);
+    if (state->HMAC_type == NULL) {
         return -1;
     }
-    if (PyModule_AddType(module, state->HMACtype) < 0) {
+    if (PyModule_AddType(module, state->HMAC_type) < 0) {
         return -1;
     }
     return 0;

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to