Issue 1242657: list(obj) can swallow KeyboardInterrupt.

This commit is contained in:
Raymond Hettinger 2009-02-02 22:55:09 +00:00
parent 9f9892648f
commit e8364233ae
6 changed files with 55 additions and 15 deletions

View file

@ -2616,6 +2616,10 @@ bytes_extend(PyByteArrayObject *self, PyObject *arg)
/* Try to determine the length of the argument. 32 is abitrary. */
buf_size = _PyObject_LengthHint(arg, 32);
if (buf_size == -1) {
Py_DECREF(it);
return NULL;
}
bytes_obj = PyByteArray_FromStringAndSize(NULL, buf_size);
if (bytes_obj == NULL)