|
|
|
@ -2128,7 +2128,7 @@ builtin_sorted(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwna |
|
|
|
{ |
|
|
|
PyObject *newlist, *v, *seq, *keyfunc=NULL; |
|
|
|
PyObject *callable; |
|
|
|
static const char * const kwlist[] = {"iterable", "key", "reverse", 0}; |
|
|
|
static const char * const kwlist[] = {"", "key", "reverse", 0}; |
|
|
|
/* args 1-3 should match listsort in Objects/listobject.c */ |
|
|
|
static _PyArg_Parser parser = {"O|Oi:sorted", kwlist, 0}; |
|
|
|
int reverse; |
|
|
|
@ -2147,6 +2147,7 @@ builtin_sorted(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwna |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
|
|
|
|
assert(nargs >= 1); |
|
|
|
v = _PyObject_FastCallKeywords(callable, args + 1, nargs - 1, kwnames); |
|
|
|
Py_DECREF(callable); |
|
|
|
if (v == NULL) { |
|
|
|
|