From 58cf7488d5dcc8f47151d09fc1fa057b4dda563b Mon Sep 17 00:00:00 2001 From: Oren Milman Date: Mon, 21 Aug 2017 20:19:07 +0300 Subject: [PATCH] bpo-31236: Improved some error messages of min() and max(). --- Python/bltinmodule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.40.0