summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-02-02 21:50:13 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-02-02 21:50:13 (GMT)
commitb516370bcbeef7391edc28fa6bfcc8da6d98beea (patch)
tree057c3efe6e2de33086e1762a5a17d68384368eb0 /Objects/listobject.c
parentd7bb4d484ff0adb0f40e34ed316e58e8a4b88a9e (diff)
downloadcpython-b516370bcbeef7391edc28fa6bfcc8da6d98beea.zip
cpython-b516370bcbeef7391edc28fa6bfcc8da6d98beea.tar.gz
cpython-b516370bcbeef7391edc28fa6bfcc8da6d98beea.tar.bz2
Issue 1242657: list(obj) can swallow KeyboardInterrupt.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c4
1 files changed, 4 insertions, 0 deletions
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 @@ 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) {