Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit aeaf294

Browse files
committed
_hashopenssl uses METH_FASTCALL
1 parent 5a60eca commit aeaf294

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Modules/_hashopenssl.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,13 +905,17 @@ generate_hash_name_list(void)
905905
*/
906906
#define GEN_CONSTRUCTOR(NAME) \
907907
static PyObject * \
908-
EVP_new_ ## NAME (PyObject *self, PyObject *args) \
908+
EVP_new_ ## NAME (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) \
909909
{ \
910910
PyObject *data_obj = NULL; \
911911
Py_buffer view = { 0 }; \
912912
PyObject *ret_obj; \
913913
\
914-
if (!PyArg_ParseTuple(args, "|O:" #NAME , &data_obj)) { \
914+
if (!_PyArg_ParseStack(args, nargs, "|O:" #NAME , &data_obj)) { \
915+
return NULL; \
916+
} \
917+
\
918+
if (!_PyArg_NoStackKeywords(#NAME, kwnames)) { \
915919
return NULL; \
916920
} \
917921
\
@@ -932,7 +936,7 @@ generate_hash_name_list(void)
932936

933937
/* a PyMethodDef structure for the constructor */
934938
#define CONSTRUCTOR_METH_DEF(NAME) \
935-
{"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_VARARGS, \
939+
{"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_FASTCALL, \
936940
PyDoc_STR("Returns a " #NAME \
937941
" hash object; optionally initialized with a string") \
938942
}

0 commit comments

Comments
 (0)