diff options
-rw-r--r-- | Objects/listobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index f2132b4..ce0f22e 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1316,7 +1316,8 @@ PyList_Sort(PyObject *v) static PyObject * listreverse(PyListObject *self) { - reverse_slice(self->ob_item, self->ob_item + self->ob_size); + if (self->ob_size > 1) + reverse_slice(self->ob_item, self->ob_item + self->ob_size); Py_INCREF(Py_None); return Py_None; } |