use Py_ssize_t rather than int when dealing with list sizes (original patch from Fedora but applied changes elsewhere too), also replace PyList_Size with PyList_GET_SIZE where typechecking is already done.

This commit is contained in:
Campbell Barton
2011-09-06 23:46:20 +00:00
parent 9baff83d72
commit 9161d3ce4b
8 changed files with 21 additions and 20 deletions

View File

@@ -546,8 +546,8 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
CListValue* listval = new CListValue();
bool error = false;
int i;
int numitems = PyList_Size(pyobj);
Py_ssize_t i;
Py_ssize_t numitems = PyList_GET_SIZE(pyobj);
for (i=0;i<numitems;i++)
{
PyObject* listitem = PyList_GetItem(pyobj,i); /* borrowed ref */