summaryrefslogtreecommitdiffstats
path: root/Python
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 /Python
parentd7bb4d484ff0adb0f40e34ed316e58e8a4b88a9e (diff)
downloadcpython-b516370bcbeef7391edc28fa6bfcc8da6d98beea.zip
cpython-b516370bcbeef7391edc28fa6bfcc8da6d98beea.tar.gz
cpython-b516370bcbeef7391edc28fa6bfcc8da6d98beea.tar.bz2
Issue 1242657: list(obj) can swallow KeyboardInterrupt.
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 4e6f901..4d7dec1 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -268,6 +268,8 @@ builtin_filter(PyObject *self, PyObject *args)
/* Guess a result list size. */
len = _PyObject_LengthHint(seq, 8);
+ if (len == -1)
+ goto Fail_it;
/* Get a result list. */
if (PyList_Check(seq) && seq->ob_refcnt == 1) {