remove 2 unnecessary checks for array type before assignment.

This commit is contained in:
2011-02-24 07:25:47 +00:00
parent fbd9364944
commit 31c7d694e0
2 changed files with 8 additions and 14 deletions

View File

@@ -1046,17 +1046,11 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
/* char error_str[512]; */
int ok= 1;
#ifdef USE_MATHUTILS
if(MatrixObject_Check(value)) {
MatrixObject *mat = (MatrixObject*)value;
if(!BaseMath_ReadCallback(mat))
return -1;
} else /* continue... */
#endif // USE_MATHUTILS
if (!PySequence_Check(value)) {
PyErr_Format(PyExc_TypeError, "%.200s RNA array assignment to %.200s.%.200s expected a sequence, not %.200s", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
return -1;
}
// if (!PySequence_Check(value)) {
// PyErr_Format(PyExc_TypeError, "%.200s RNA array assignment to %.200s.%.200s expected a sequence, not %.200s", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), Py_TYPE(value)->tp_name);
// return -1;
// }
/* done getting the length */
ok= pyrna_py_to_array(ptr, prop, data, value, error_prefix);