1
0
forked from aniani/vim

patch 9.1.1251: if_python: build error with tuples and dynamic python

Problem:  if_python: build error with tuples and dynamic python
          (after v9.1.1239)
Solution: Fix build error and test failures (Yee Cheng Cin)

closes: #16992

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yee Cheng Chin
2025-03-27 20:13:33 +01:00
committed by Christian Brabandt
parent 88d75934c3
commit e06b2aea43
4 changed files with 11 additions and 14 deletions

View File

@@ -1097,12 +1097,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
if (ret == NULL)
return NULL;
if (PyDict_SetItemString(lookup_dict, ptrBuf, ret))
{
Py_DECREF(ret);
return NULL;
}
for (int idx = 0; idx < len; idx++)
{
typval_T *item_tv = TUPLE_ITEM(tuple, idx);
@@ -1113,7 +1107,13 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
Py_DECREF(ret);
return NULL;
}
PyTuple_SET_ITEM(ret, idx, newObj);
PyTuple_SetItem(ret, idx, newObj);
}
if (PyDict_SetItemString(lookup_dict, ptrBuf, ret))
{
Py_DECREF(ret);
return NULL;
}
}
else if (our_tv->v_type == VAR_DICT)
@@ -3440,7 +3440,7 @@ TupleSlice(
return NULL;
}
PyTuple_SET_ITEM(tuple, i, item);
PyTuple_SetItem(tuple, i, item);
}
return tuple;