Problem: Crash when using Python list iterator.
Solution: Increment the list reference count. (closes #7886)
ListIterDestruct(listiterinfo_T *lii)
{
list_rem_watch(lii->list, &lii->lw);
+ list_unref(lii->list);
PyMem_Free(lii);
}
list_add_watch(l, &lii->lw);
lii->lw.lw_item = l->lv_first;
lii->list = l;
+ ++l->lv_refcount;
return IterNew(lii,
(destructorfun) ListIterDestruct, (nextfun) ListIterNext,
py3 ll[2] = 8
call assert_equal([1, 2, 8], l)
+ " iterating over list from Python
+ py3 print([x for x in vim.Function("getline")(1, 2)])
+
" Using dict as an index
call AssertException(['py3 ll[{}] = 10'],
\ 'Vim(py3):TypeError: index must be int or slice, not dict')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2538,
/**/
2537,
/**/