commit | 24e2872f0d04c0d7c1745f677aef1a335433b556 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Mon Feb 02 22:44:06 2009 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Mon Feb 02 22:44:06 2009 +0000 |
tree | d11c883d601cda87a46839fbc6ba321089c6cb61 | |
parent | b2dbd4309aa3d2a8a823d251447b8fd8b4b2d7e3 [diff] [blame] |
Issue 1242657: list(obj) can swallow KeyboardInterrupt
diff --git a/Objects/listobject.c b/Objects/listobject.c index 7b4bf35..98d7e47 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c
@@ -838,6 +838,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) {