diff options
author | Oren Milman <orenmn@gmail.com> | 2017-08-21 17:19:07 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-08-21 17:19:07 (GMT) |
commit | 58cf7488d5dcc8f47151d09fc1fa057b4dda563b (patch) | |
tree | 5e2c85ab2531091070d89b489fee0e894cd92aab /Python/bltinmodule.c | |
parent | 84524454d0ba77d299741c47bd0f5841ac3f66ce (diff) | |
download | cpython-58cf7488d5dcc8f47151d09fc1fa057b4dda563b.zip cpython-58cf7488d5dcc8f47151d09fc1fa057b4dda563b.tar.gz cpython-58cf7488d5dcc8f47151d09fc1fa057b4dda563b.tar.bz2 |
bpo-31236: Improved some error messages of min() and max().
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 85f207b..5e1f1d3 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; |