diff --git a/Objects/listobject.c b/Objects/listobject.c index 9a8b64e76f5..9e865921012 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -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) {