summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorOren Milman <orenmn@gmail.com>2017-08-21 20:19:07 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2017-08-21 20:19:07 +0300
commit58cf7488d5dcc8f47151d09fc1fa057b4dda563b (patch)
tree5e2c85ab2531091070d89b489fee0e894cd92aab /Python
parent84524454d0ba77d299741c47bd0f5841ac3f66ce (diff)
downloadcpython-git-58cf7488d5dcc8f47151d09fc1fa057b4dda563b.tar.gz
bpo-31236: Improved some error messages of min() and max().
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c5
1 files 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;