From: Oren Milman Date: Mon, 21 Aug 2017 17:19:07 +0000 (+0300) Subject: bpo-31236: Improved some error messages of min() and max(). X-Git-Tag: v3.7.0a1~240 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58cf7488d5dcc8f47151d09fc1fa057b4dda563b;p=python bpo-31236: Improved some error messages of min() and max(). --- diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 85f207b68e..5e1f1d3854 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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;