mirror of https://github.com/python/cpython
Issue: 2354: Add 3K warning for the cmp argument to list.sort() and sorted().
This commit is contained in:
parent
9a47e6201f
commit
6c0ff8aacd
|
@ -2037,6 +2037,11 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
|
|||
}
|
||||
if (compare == Py_None)
|
||||
compare = NULL;
|
||||
if (compare == NULL &&
|
||||
Py_Py3kWarningFlag &&
|
||||
PyErr_Warn(PyExc_DeprecationWarning,
|
||||
"In 3.x, the cmp argument is no longer supported.") < 0)
|
||||
return NULL;
|
||||
if (keyfunc == Py_None)
|
||||
keyfunc = NULL;
|
||||
if (compare != NULL && keyfunc != NULL) {
|
||||
|
|
Loading…
Reference in New Issue