Browse Source

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

pull/3170/merge
Oren Milman 9 years ago
committed by Serhiy Storchaka
parent
commit
58cf7488d5
  1. 5
      Python/bltinmodule.c

5
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;

Loading…
Cancel
Save