mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.1146: not enough testing for Python
Problem: Not enough testing for Python. Solution: Add more tests. Fix uncovered problems. (Yegappan Lakshmanan, closes #6392)
This commit is contained in:
@@ -2250,6 +2250,9 @@ ListNew(PyTypeObject *subtype, list_T *list)
|
||||
{
|
||||
ListObject *self;
|
||||
|
||||
if (list == NULL)
|
||||
return NULL;
|
||||
|
||||
self = (ListObject *) subtype->tp_alloc(subtype, 0);
|
||||
if (self == NULL)
|
||||
return NULL;
|
||||
@@ -2695,6 +2698,12 @@ ListAssIndex(ListObject *self, Py_ssize_t index, PyObject *obj)
|
||||
if (obj == NULL)
|
||||
{
|
||||
li = list_find(l, (long) index);
|
||||
if (li == NULL)
|
||||
{
|
||||
PyErr_VIM_FORMAT(N_("internal error: failed to get Vim "
|
||||
"list item %d"), (int) index);
|
||||
return -1;
|
||||
}
|
||||
vimlist_remove(l, li, li);
|
||||
clear_tv(&li->li_tv);
|
||||
vim_free(li);
|
||||
@@ -2716,6 +2725,12 @@ ListAssIndex(ListObject *self, Py_ssize_t index, PyObject *obj)
|
||||
else
|
||||
{
|
||||
li = list_find(l, (long) index);
|
||||
if (li == NULL)
|
||||
{
|
||||
PyErr_VIM_FORMAT(N_("internal error: failed to get Vim "
|
||||
"list item %d"), (int) index);
|
||||
return -1;
|
||||
}
|
||||
clear_tv(&li->li_tv);
|
||||
copy_tv(&tv, &li->li_tv);
|
||||
clear_tv(&tv);
|
||||
@@ -3897,7 +3912,7 @@ WindowDestructor(WindowObject *self)
|
||||
PyObject_GC_UnTrack((void *)(self));
|
||||
if (self->win && self->win != INVALID_WINDOW_VALUE)
|
||||
WIN_PYTHON_REF(self->win) = NULL;
|
||||
Py_XDECREF(((PyObject *)(self->tabObject)));
|
||||
Py_XDECREF(((PyObject *)(self->tabObject)));
|
||||
PyObject_GC_Del((void *)(self));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user