Issue 1242657: list(obj) can swallow KeyboardInterrupt.

This commit is contained in:
Raymond Hettinger 2009-02-02 21:50:13 +00:00
parent d7bb4d484f
commit b516370bcb
7 changed files with 65 additions and 15 deletions

View file

@ -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) {