mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033)
In _localemodule.c and selectmodule.c, remove dead code that would cause double decrefs if run. In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases where a new list is populated and there is no possibility of an error. In addition, check if the list changed size in the loop in array_array_fromlist().
This commit is contained in:
parent
f05df0a4b6
commit
99d56b5356
7 changed files with 25 additions and 30 deletions
|
@ -2594,7 +2594,7 @@ makepathobject(const wchar_t *path, wchar_t delim)
|
|||
Py_DECREF(v);
|
||||
return NULL;
|
||||
}
|
||||
PyList_SetItem(v, i, w);
|
||||
PyList_SET_ITEM(v, i, w);
|
||||
if (*p == '\0')
|
||||
break;
|
||||
path = p+1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue