Issue 1242657: list(obj) can swallow KeyboardInterrupt.

This commit is contained in:
Raymond Hettinger 2009-02-02 22:55:09 +00:00
parent 9f9892648f
commit e8364233ae
6 changed files with 55 additions and 15 deletions

View file

@ -802,6 +802,10 @@ listextend(PyListObject *self, PyObject *b)
/* Guess a result list size. */
n = _PyObject_LengthHint(b, 8);
if (n == -1) {
Py_DECREF(it);
return NULL;
}
m = Py_SIZE(self);
mn = m + n;
if (mn >= m) {