commit | e8364233aea88cf68e8f54a515dce10160ead35b | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Mon Feb 02 22:55:09 2009 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Mon Feb 02 22:55:09 2009 +0000 |
tree | bbe6369d9536d20602676c097b8c60ce8fa325a0 | |
parent | 9f9892648f954e45a628113febb524261075db32 [diff] [blame] |
Issue 1242657: list(obj) can swallow KeyboardInterrupt.
diff --git a/Objects/listobject.c b/Objects/listobject.c index b834363..2bab4ef 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c
@@ -802,6 +802,10 @@ /* 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) {