diff options
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r-- | Objects/listobject.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index 18d3b90..efcedc7 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -758,17 +758,7 @@ listextend(PyListObject *self, PyObject *b) iternext = *it->ob_type->tp_iternext; /* Guess a result list size. */ - n = _PyObject_LengthHint(b); - if (n < 0) { - if (PyErr_Occurred() - && !PyErr_ExceptionMatches(PyExc_TypeError) - && !PyErr_ExceptionMatches(PyExc_AttributeError)) { - Py_DECREF(it); - return NULL; - } - PyErr_Clear(); - n = 8; /* arbitrary */ - } + n = _PyObject_LengthHint(b, 8); m = Py_Size(self); mn = m + n; if (mn >= m) { |