game engine python api
[blender.git] / source / gameengine / Expressions / ListValue.cpp
index bbf58a8a06e60100a2f4c03a5d25c796f59fc7c3..9ffdbb1223c930da662314e43751fea758b86066 100644 (file)
@@ -43,7 +43,7 @@ PyObject* listvalue_buffer_item(PyObject* list,Py_ssize_t index)
                        return ((CListValue*) list)->GetValue(index)->AddRef();
 
        }
-       Py_Error(PyExc_IndexError, "Python ListIndex out of range");  
+       PyErr_SetString(PyExc_IndexError, "Python ListIndex out of range");
        return NULL;
 }
 
@@ -130,9 +130,10 @@ listvalue_buffer_concat(PyObject * self, PyObject * other)
                        }
                }
 
-               if (error)
-                       Py_Error(PyExc_SystemError, "Python Error: couldn't add one or more items to a list");  
-               
+               if (error) {
+                       PyErr_SetString(PyExc_SystemError, "Python Error: couldn't add one or more items to a list");
+                       return NULL;
+               }
 
        } else
        {
@@ -155,8 +156,8 @@ listvalue_buffer_concat(PyObject * self, PyObject * other)
                                listval->Add(objval);
                        } else
                        {
-                               Py_Error(PyExc_SystemError, "Python Error: couldn't add item to a list");  
-                               // bad luck
+                               PyErr_SetString(PyExc_SystemError, "Python Error: couldn't add item to a list");  
+                               return NULL;
                        }
                }
        }