mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Issue 1242657: list(obj) can swallow KeyboardInterrupt.
This commit is contained in:
parent
d7bb4d484f
commit
b516370bcb
7 changed files with 65 additions and 15 deletions
|
@ -838,6 +838,10 @@ listextend(PyListObject *self, PyObject *b)
|
|||
|
||||
/* Guess a result list size. */
|
||||
n = _PyObject_LengthHint(b, 8);
|
||||
if (n == -1) {
|
||||
Py_DECREF(it);
|
||||
return NULL;
|
||||
}
|
||||
m = Py_SIZE(self);
|
||||
mn = m + n;
|
||||
if (mn >= m) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue