mirror of
https://github.com/python/cpython
synced 2026-09-29 11:30:29 +03:00
Issue #18531: Single var-keyword argument of dict subtype was passed
unscathed to the C-defined function. Now it is converted to exact dict.
This commit is contained in:
parent
a26e4b97d8
commit
ce41287e99
4 changed files with 82 additions and 1 deletions
|
|
@ -872,6 +872,26 @@ test_L_code(PyObject *self)
|
|||
|
||||
#endif /* ifdef HAVE_LONG_LONG */
|
||||
|
||||
static PyObject *
|
||||
get_args(PyObject *self, PyObject *args)
|
||||
{
|
||||
if (args == NULL) {
|
||||
args = Py_None;
|
||||
}
|
||||
Py_INCREF(args);
|
||||
return args;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
get_kwargs(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
if (kwargs == NULL) {
|
||||
kwargs = Py_None;
|
||||
}
|
||||
Py_INCREF(kwargs);
|
||||
return kwargs;
|
||||
}
|
||||
|
||||
/* Test tuple argument processing */
|
||||
static PyObject *
|
||||
getargs_tuple(PyObject *self, PyObject *args)
|
||||
|
|
@ -3784,6 +3804,8 @@ static PyMethodDef TestMethods[] = {
|
|||
{"test_pep3118_obsolete_write_locks", (PyCFunction)test_pep3118_obsolete_write_locks, METH_NOARGS},
|
||||
#endif
|
||||
{"getbuffer_with_null_view", getbuffer_with_null_view, METH_O},
|
||||
{"get_args", get_args, METH_VARARGS},
|
||||
{"get_kwargs", (PyCFunction)get_kwargs, METH_VARARGS|METH_KEYWORDS},
|
||||
{"getargs_tuple", getargs_tuple, METH_VARARGS},
|
||||
{"getargs_keywords", (PyCFunction)getargs_keywords,
|
||||
METH_VARARGS|METH_KEYWORDS},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue