From b516370bcbeef7391edc28fa6bfcc8da6d98beea Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 2 Feb 2009 21:50:13 +0000 Subject: Issue 1242657: list(obj) can swallow KeyboardInterrupt. --- Python/bltinmodule.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 4e6f901ab3..4d7dec1c3f 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) { -- cgit v1.2.1