Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58cf748

Browse files
orenmnserhiy-storchaka
authored andcommitted
bpo-31236: Improved some error messages of min() and max().
1 parent 8452445 commit 58cf748

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Python/bltinmodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,8 +1519,9 @@ min_max(PyObject *args, PyObject *kwds, int op)
15191519
emptytuple = PyTuple_New(0);
15201520
if (emptytuple == NULL)
15211521
return NULL;
1522-
ret = PyArg_ParseTupleAndKeywords(emptytuple, kwds, "|$OO", kwlist,
1523-
&keyfunc, &defaultval);
1522+
ret = PyArg_ParseTupleAndKeywords(emptytuple, kwds,
1523+
(op == Py_LT) ? "|$OO:min" : "|$OO:max",
1524+
kwlist, &keyfunc, &defaultval);
15241525
Py_DECREF(emptytuple);
15251526
if (!ret)
15261527
return NULL;

0 commit comments

Comments
 (0)