diff --git a/Objects/listobject.c b/Objects/listobject.c index 2cb08d31665..45b0951da3e 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -421,7 +421,7 @@ list_repeat(PyListObject *a, int n) if (n < 0) n = 0; size = a->ob_size * n; - if (size/a->ob_size != n) + if (n && size/n != a->ob_size) return PyErr_NoMemory(); np = (PyListObject *) PyList_New(size); if (np == NULL)