mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue 1242657: list(obj) can swallow KeyboardInterrupt.
This commit is contained in:
parent
9f9892648f
commit
e8364233ae
6 changed files with 55 additions and 15 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue