use Py_ssize_t rather than int when dealing with list sizes (original patch from...
[blender.git] / source / blender / python / generic / bpy_internal_import.c
index f0158fe72c30b9da9c8163076ec44d4de227179f..67ed90c79eb164890448f64025b736e3af3b0df6 100644 (file)
@@ -344,7 +344,7 @@ void bpy_text_clear_modules(int clear_all)
        
        /* looping over the dict */
        PyObject *key, *value;
-       int pos= 0;
+       Py_ssize_t pos= 0;
        
        /* new list */
        PyObject *list;
@@ -374,7 +374,7 @@ void bpy_text_clear_modules(int clear_all)
        }
        
        /* remove all our modules */
-       for(pos=0; pos < PyList_Size(list); pos++) {
+       for(pos=0; pos < PyList_GET_SIZE(list); pos++) {
                /* PyObject_Print(key, stderr, 0); */
                key= PyList_GET_ITEM(list, pos);
                PyDict_DelItem(modules, key);