Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-39829: __len__ called twice in the list() constructor
  • Loading branch information
thatbirdguythatuknownot authored Mar 8, 2022
commit 12eba0364b67fb0d75d372b2c06ab1126cb79574
8 changes: 3 additions & 5 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,9 @@ list_extend(PyListObject *self, PyObject *iterable)
return NULL;
}
}
else {
if (list_resize(self, m + n) < 0) {
Py_DECREF(iterable);
return NULL;
}
else if (list_resize(self, m + n) < 0) {
Py_DECREF(iterable);
return NULL;
}
/* note that we may still have self == iterable here for the
* situation a.extend(a), but the following code works
Expand Down