bpo-31236: Improved some error messages of min() and max().

This commit is contained in:
Oren Milman 2017-08-21 20:19:07 +03:00 committed by Serhiy Storchaka
parent 84524454d0
commit 58cf7488d5
1 changed files with 3 additions and 2 deletions

View File

@ -1519,8 +1519,9 @@ min_max(PyObject *args, PyObject *kwds, int op)
emptytuple = PyTuple_New(0);
if (emptytuple == NULL)
return NULL;
ret = PyArg_ParseTupleAndKeywords(emptytuple, kwds, "|$OO", kwlist,
&keyfunc, &defaultval);
ret = PyArg_ParseTupleAndKeywords(emptytuple, kwds,
(op == Py_LT) ? "|$OO:min" : "|$OO:max",
kwlist, &keyfunc, &defaultval);
Py_DECREF(emptytuple);
if (!ret)
return NULL;