mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Issue #29327: Fixed a crash when pass the iterable keyword argument to sorted().
This commit is contained in:
parent
a57a8a3e2d
commit
398ef5c08f
3 changed files with 15 additions and 1 deletions
|
@ -2123,7 +2123,7 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
{
|
||||
PyObject *newlist, *v, *seq, *keyfunc=NULL, **newargs;
|
||||
PyObject *callable;
|
||||
static char *kwlist[] = {"iterable", "key", "reverse", 0};
|
||||
static char *kwlist[] = {"", "key", "reverse", 0};
|
||||
int reverse;
|
||||
Py_ssize_t nargs;
|
||||
|
||||
|
@ -2142,6 +2142,7 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
assert(PyTuple_GET_SIZE(args) >= 1);
|
||||
newargs = &PyTuple_GET_ITEM(args, 1);
|
||||
nargs = PyTuple_GET_SIZE(args) - 1;
|
||||
v = _PyObject_FastCallDict(callable, newargs, nargs, kwds);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue