Skip to content

Commit 7e60192

Browse files
serhiy-storchakavstinner
authored andcommitted
Remove _PyArg_NoStackKeywords(). (#2641)
1 parent bb2bae8 commit 7e60192

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

Include/modsupport.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,9 @@ PyAPI_FUNC(int) _PyArg_UnpackStack(
6060
...);
6161

6262
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
63-
PyAPI_FUNC(int) _PyArg_NoStackKeywords(const char *funcname, PyObject *kwnames);
6463
PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
6564
#define _PyArg_NoKeywords(funcname, kwargs) \
6665
((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs)))
67-
#define _PyArg_NoStackKeywords(funcname, kwnames) \
68-
((kwnames) == NULL || _PyArg_NoStackKeywords((funcname), (kwnames)))
6966
#define _PyArg_NoPositional(funcname, args) \
7067
((args) == NULL || _PyArg_NoPositional((funcname), (args)))
7168

Modules/_hashopenssl.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -925,15 +925,11 @@ generate_hash_name_list(void)
925925
*/
926926
#define GEN_CONSTRUCTOR(NAME) \
927927
static PyObject * \
928-
EVP_new_ ## NAME (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) \
928+
EVP_new_ ## NAME (PyObject *self, PyObject **args, Py_ssize_t nargs) \
929929
{ \
930930
PyObject *data_obj = NULL; \
931931
Py_buffer view = { 0 }; \
932932
PyObject *ret_obj; \
933-
\
934-
if (!_PyArg_NoStackKeywords(#NAME, kwnames)) { \
935-
return NULL; \
936-
} \
937933
\
938934
if (!_PyArg_ParseStack(args, nargs, "|O:" #NAME , &data_obj)) { \
939935
return NULL; \
@@ -967,7 +963,7 @@ generate_hash_name_list(void)
967963

968964
/* a PyMethodDef structure for the constructor */
969965
#define CONSTRUCTOR_METH_DEF(NAME) \
970-
{"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_FASTCALL | METH_KEYWORDS, \
966+
{"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_FASTCALL, \
971967
PyDoc_STR("Returns a " #NAME \
972968
" hash object; optionally initialized with a string") \
973969
}

Python/getargs.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,6 @@ _PyArg_UnpackStack(PyObject **args, Py_ssize_t nargs, const char *name,
24832483

24842484

24852485
#undef _PyArg_NoKeywords
2486-
#undef _PyArg_NoStackKeywords
24872486
#undef _PyArg_NoPositional
24882487

24892488
/* For type constructors that don't take keyword args
@@ -2511,23 +2510,6 @@ _PyArg_NoKeywords(const char *funcname, PyObject *kwargs)
25112510
}
25122511

25132512

2514-
int
2515-
_PyArg_NoStackKeywords(const char *funcname, PyObject *kwnames)
2516-
{
2517-
if (kwnames == NULL) {
2518-
return 1;
2519-
}
2520-
assert(PyTuple_CheckExact(kwnames));
2521-
if (PyTuple_GET_SIZE(kwnames) == 0) {
2522-
return 1;
2523-
}
2524-
2525-
PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
2526-
funcname);
2527-
return 0;
2528-
}
2529-
2530-
25312513
int
25322514
_PyArg_NoPositional(const char *funcname, PyObject *args)
25332515
{

0 commit comments

Comments
 (0)