formatting changes for python mathutils module.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 14 Jul 2011 01:25:05 +0000 (01:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 14 Jul 2011 01:25:05 +0000 (01:25 +0000)
source/blender/python/generic/mathutils.c
source/blender/python/generic/mathutils_Color.c
source/blender/python/generic/mathutils_Euler.c
source/blender/python/generic/mathutils_Matrix.c
source/blender/python/generic/mathutils_Quaternion.c
source/blender/python/generic/mathutils_Vector.c
source/blender/python/generic/mathutils_geometry.c

index 30f4e5b7ffeb6fccf963f5f01607646d39718742..bba08e312b748c9652c13bc197f99c8be4ce5cf7 100644 (file)
@@ -57,8 +57,16 @@ static int mathutils_array_parse_fast(float *array, int array_min, int array_max
        size= PySequence_Fast_GET_SIZE(value_fast);
 
        if(size > array_max || size < array_min) {
-               if (array_max == array_min)     PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected %d", error_prefix, size, array_max);
-               else                                            PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected [%d - %d]", error_prefix, size, array_min, array_max);
+               if (array_max == array_min)     {
+                       PyErr_Format(PyExc_ValueError,
+                                    "%.200s: sequence size is %d, expected %d",
+                                    error_prefix, size, array_max);
+               }
+               else {
+                       PyErr_Format(PyExc_ValueError,
+                                    "%.200s: sequence size is %d, expected [%d - %d]",
+                                    error_prefix, size, array_min, array_max);
+               }
                Py_DECREF(value_fast);
                return -1;
        }
@@ -67,7 +75,10 @@ static int mathutils_array_parse_fast(float *array, int array_min, int array_max
        do {
                i--;
                if(((array[i]= PyFloat_AsDouble((item= PySequence_Fast_GET_ITEM(value_fast, i)))) == -1.0f) && PyErr_Occurred()) {
-                       PyErr_Format(PyExc_ValueError, "%.200s: sequence index %d expected a number, found '%.200s' type, ", error_prefix, i, Py_TYPE(item)->tp_name);
+                       PyErr_Format(PyExc_ValueError,
+                                    "%.200s: sequence index %d expected a number, "
+                                    "found '%.200s' type, ",
+                                    error_prefix, i, Py_TYPE(item)->tp_name);
                        Py_DECREF(value_fast);
                        return -1;
                }
@@ -93,8 +104,16 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *
                }
 
                if(size > array_max || size < array_min) {
-                       if (array_max == array_min)     PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected %d", error_prefix, size, array_max);
-                       else                                            PyErr_Format(PyExc_ValueError, "%.200s: sequence size is %d, expected [%d - %d]", error_prefix, size, array_min, array_max);
+                       if (array_max == array_min)     {
+                               PyErr_Format(PyExc_ValueError,
+                                            "%.200s: sequence size is %d, expected %d",
+                                            error_prefix, size, array_max);
+                       }
+                       else {
+                               PyErr_Format(PyExc_ValueError,
+                                            "%.200s: sequence size is %d, expected [%d - %d]",
+                                            error_prefix, size, array_min, array_max);
+                       }
                        return -1;
                }
 
@@ -135,7 +154,9 @@ int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error
                        return -1;
                }
                else if(((MatrixObject *)value)->col_size < 3 || ((MatrixObject *)value)->row_size < 3) {
-                       PyErr_Format(PyExc_ValueError, "%.200s: matrix must have minimum 3x3 dimensions", error_prefix);
+                       PyErr_Format(PyExc_ValueError,
+                                    "%.200s: matrix must have minimum 3x3 dimensions",
+                                    error_prefix);
                        return -1;
                }
                else {
@@ -145,7 +166,9 @@ int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "%.200s: expected a Euler, Quaternion or Matrix type, found %.200s", error_prefix, Py_TYPE(value)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "%.200s: expected a Euler, Quaternion or Matrix type, "
+                            "found %.200s", error_prefix, Py_TYPE(value)->tp_name);
                return -1;
        }
 }
@@ -213,8 +236,11 @@ int _BaseMathObject_ReadCallback(BaseMathObject *self)
        if(cb->get(self, self->cb_subtype) != -1)
                return 0;
 
-       if(!PyErr_Occurred())
-               PyErr_Format(PyExc_RuntimeError, "%s read, user has become invalid", Py_TYPE(self)->tp_name);
+       if(!PyErr_Occurred()) {
+               PyErr_Format(PyExc_RuntimeError,
+                            "%s read, user has become invalid",
+                            Py_TYPE(self)->tp_name);
+       }
        return -1;
 }
 
@@ -224,8 +250,11 @@ int _BaseMathObject_WriteCallback(BaseMathObject *self)
        if(cb->set(self, self->cb_subtype) != -1)
                return 0;
 
-       if(!PyErr_Occurred())
-               PyErr_Format(PyExc_RuntimeError, "%s write, user has become invalid", Py_TYPE(self)->tp_name);
+       if(!PyErr_Occurred()) {
+               PyErr_Format(PyExc_RuntimeError,
+                            "%s write, user has become invalid",
+                            Py_TYPE(self)->tp_name);
+       }
        return -1;
 }
 
@@ -235,8 +264,11 @@ int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index)
        if(cb->get_index(self, self->cb_subtype, index) != -1)
                return 0;
 
-       if(!PyErr_Occurred())
-               PyErr_Format(PyExc_RuntimeError, "%s read index, user has become invalid", Py_TYPE(self)->tp_name);
+       if(!PyErr_Occurred()) {
+               PyErr_Format(PyExc_RuntimeError,
+                            "%s read index, user has become invalid",
+                            Py_TYPE(self)->tp_name);
+       }
        return -1;
 }
 
@@ -246,8 +278,11 @@ int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index)
        if(cb->set_index(self, self->cb_subtype, index) != -1)
                return 0;
 
-       if(!PyErr_Occurred())
-               PyErr_Format(PyExc_RuntimeError, "%s write index, user has become invalid", Py_TYPE(self)->tp_name);
+       if(!PyErr_Occurred()) {
+               PyErr_Format(PyExc_RuntimeError,
+                            "%s write index, user has become invalid",
+                            Py_TYPE(self)->tp_name);
+       }
        return -1;
 }
 
index c59cb501d868d41c04263cac17c6ca02f84f085a..fd187fd92fd8d8c70b6e538ac86f49a6df82f4bb 100644 (file)
@@ -43,7 +43,9 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
        float col[3]= {0.0f, 0.0f, 0.0f};
 
        if(kwds && PyDict_Size(kwds)) {
-               PyErr_SetString(PyExc_TypeError, "mathutils.Color(): takes no keyword args");
+               PyErr_SetString(PyExc_TypeError,
+                               "mathutils.Color(): "
+                               "takes no keyword args");
                return NULL;
        }
 
@@ -55,7 +57,9 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
                        return NULL;
                break;
        default:
-               PyErr_SetString(PyExc_TypeError, "mathutils.Color(): more then a single arg given");
+               PyErr_SetString(PyExc_TypeError,
+                               "mathutils.Color(): "
+                               "more then a single arg given");
                return NULL;
        }
        return newColorObject(col, Py_NEW, type);
@@ -174,7 +178,9 @@ static PyObject *Color_item(ColorObject * self, int i)
        if(i<0) i= COLOR_SIZE-i;
 
        if(i < 0 || i >= COLOR_SIZE) {
-               PyErr_SetString(PyExc_IndexError, "color[attribute]: array index out of range");
+               PyErr_SetString(PyExc_IndexError,
+                               "color[attribute]: "
+                               "array index out of range");
                return NULL;
        }
 
@@ -191,14 +197,17 @@ static int Color_ass_item(ColorObject * self, int i, PyObject *value)
        float f = PyFloat_AsDouble(value);
 
        if(f == -1 && PyErr_Occurred()) { // parsed item not a number
-               PyErr_SetString(PyExc_TypeError, "color[attribute] = x: argument not a number");
+               PyErr_SetString(PyExc_TypeError,
+                               "color[attribute] = x: "
+                               "argument not a number");
                return -1;
        }
 
        if(i<0) i= COLOR_SIZE-i;
 
        if(i < 0 || i >= COLOR_SIZE){
-               PyErr_SetString(PyExc_IndexError, "color[attribute] = x: array assignment index out of range");
+               PyErr_SetString(PyExc_IndexError, "color[attribute] = x: "
+                               "array assignment index out of range");
                return -1;
        }
 
@@ -250,7 +259,9 @@ static int Color_ass_slice(ColorObject *self, int begin, int end, PyObject *seq)
                return -1;
 
        if(size != (end - begin)){
-               PyErr_SetString(PyExc_TypeError, "color[begin:end] = []: size mismatch in slice assignment");
+               PyErr_SetString(PyExc_TypeError,
+                               "color[begin:end] = []: "
+                               "size mismatch in slice assignment");
                return -1;
        }
 
@@ -285,12 +296,15 @@ static PyObject *Color_subscript(ColorObject *self, PyObject *item)
                        return Color_slice(self, start, stop);
                }
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with color");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with color");
                        return NULL;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "color indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "color indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return NULL;
        }
 }
@@ -314,12 +328,15 @@ static int Color_ass_subscript(ColorObject *self, PyObject *item, PyObject *valu
                if (step == 1)
                        return Color_ass_slice(self, start, stop, value);
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with color");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with color");
                        return -1;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "color indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "color indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return -1;
        }
 }
@@ -354,7 +371,9 @@ static PyObject *Color_add(PyObject *v1, PyObject *v2)
        float col[COLOR_SIZE];
 
        if (!ColorObject_Check(v1) || !ColorObject_Check(v2)) {
-               PyErr_SetString(PyExc_AttributeError, "Color addition: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Color addition: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        color1 = (ColorObject*)v1;
@@ -374,7 +393,9 @@ static PyObject *Color_iadd(PyObject *v1, PyObject *v2)
        ColorObject *color1 = NULL, *color2 = NULL;
 
        if (!ColorObject_Check(v1) || !ColorObject_Check(v2)) {
-               PyErr_SetString(PyExc_AttributeError, "Color addition: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Color addition: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        color1 = (ColorObject*)v1;
@@ -397,7 +418,9 @@ static PyObject *Color_sub(PyObject *v1, PyObject *v2)
        float col[COLOR_SIZE];
 
        if (!ColorObject_Check(v1) || !ColorObject_Check(v2)) {
-               PyErr_SetString(PyExc_AttributeError, "Color subtraction: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Color subtraction: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        color1 = (ColorObject*)v1;
@@ -417,7 +440,9 @@ static PyObject *Color_isub(PyObject *v1, PyObject *v2)
        ColorObject *color1= NULL, *color2= NULL;
 
        if (!ColorObject_Check(v1) || !ColorObject_Check(v2)) {
-               PyErr_SetString(PyExc_AttributeError, "Color subtraction: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Color subtraction: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        color1 = (ColorObject*)v1;
@@ -476,7 +501,10 @@ static PyObject *Color_mul(PyObject *v1, PyObject *v2)
                BLI_assert(!"internal error");
        }
 
-       PyErr_Format(PyExc_TypeError, "Color multiplication: not supported between '%.200s' and '%.200s' types", Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
+       PyErr_Format(PyExc_TypeError,
+                    "Color multiplication: not supported between "
+                    "'%.200s' and '%.200s' types",
+                    Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
        return NULL;
 }
 
@@ -491,20 +519,25 @@ static PyObject *Color_div(PyObject *v1, PyObject *v2)
                        return NULL;
        }
        else {
-               PyErr_SetString(PyExc_TypeError, "Color division not supported in this order");
+               PyErr_SetString(PyExc_TypeError,
+                               "Color division not supported in this order");
                return NULL;
        }
 
        /* make sure v1 is always the vector */
        if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* COLOR * FLOAT */
                if(scalar==0.0f) {
-                       PyErr_SetString(PyExc_ZeroDivisionError, "Color division: divide by zero error");
+                       PyErr_SetString(PyExc_ZeroDivisionError,
+                                       "Color division: divide by zero error");
                        return NULL;
                }
                return color_mul_float(color1, 1.0f / scalar);
        }
 
-       PyErr_Format(PyExc_TypeError, "Color multiplication: not supported between '%.200s' and '%.200s' types", Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
+       PyErr_Format(PyExc_TypeError,
+                    "Color multiplication: not supported between "
+                    "'%.200s' and '%.200s' types",
+                    Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
        return NULL;
 }
 
@@ -543,14 +576,17 @@ static PyObject *Color_idiv(PyObject *v1, PyObject *v2)
        /* only support color /= float */
        if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* COLOR /= FLOAT */
                if(scalar==0.0f) {
-                       PyErr_SetString(PyExc_ZeroDivisionError, "Color division: divide by zero error");
+                       PyErr_SetString(PyExc_ZeroDivisionError,
+                                       "Color division: divide by zero error");
                        return NULL;
                }
 
                mul_vn_fl(color->col, COLOR_SIZE, 1.0f / scalar);
        }
        else {
-               PyErr_SetString(PyExc_TypeError, "Color multiplication: arguments not acceptable for this operation");
+               PyErr_SetString(PyExc_TypeError,
+                               "Color multiplication: "
+                               "arguments not acceptable for this operation");
                return NULL;
        }
 
@@ -642,7 +678,9 @@ static int Color_setChannelHSV(ColorObject * self, PyObject *value, void * type)
        float f = PyFloat_AsDouble(value);
 
        if(f == -1 && PyErr_Occurred()) {
-               PyErr_SetString(PyExc_TypeError, "color.h/s/v = value: argument not a number");
+               PyErr_SetString(PyExc_TypeError,
+                               "color.h/s/v = value: "
+                               "argument not a number");
                return -1;
        }
 
@@ -808,7 +846,8 @@ PyObject *newColorObject(float *col, int type, PyTypeObject *base_type)
                        self->wrapped = Py_NEW;
                }
                else {
-                       PyErr_SetString(PyExc_RuntimeError, "Color(): invalid type");
+                       PyErr_SetString(PyExc_RuntimeError,
+                                       "Color(): invalid type, internal error");
                        return NULL;
                }
        }
index 4281c7bf6c53bace5e00ae04ceb5250fa253a957..2888b0667f16779daa1dcb6c1f10307ec442d16a 100644 (file)
@@ -55,7 +55,9 @@ static PyObject *Euler_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
        short order= EULER_ORDER_XYZ;
 
        if(kwds && PyDict_Size(kwds)) {
-               PyErr_SetString(PyExc_TypeError, "mathutils.Euler(): takes no keyword args");
+               PyErr_SetString(PyExc_TypeError,
+                               "mathutils.Euler(): "
+                               "takes no keyword args");
                return NULL;
        }
 
@@ -97,7 +99,9 @@ short euler_order_from_string(const char *str, const char *error_prefix)
                }
        }
 
-       PyErr_Format(PyExc_TypeError, "%s: invalid euler order '%s'", error_prefix, str);
+       PyErr_Format(PyExc_TypeError,
+                    "%s: invalid euler order '%s'",
+                    error_prefix, str);
        return -1;
 }
 
@@ -199,11 +203,14 @@ static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args)
        const char *axis;
 
        if(!PyArg_ParseTuple(args, "sf:rotate", &axis, &angle)){
-               PyErr_SetString(PyExc_TypeError, "euler.rotate(): expected angle (float) and axis (x, y, z)");
+               PyErr_SetString(PyExc_TypeError,
+                               "euler.rotate(): "
+                               "expected angle (float) and axis (x, y, z)");
                return NULL;
        }
        if(!(ELEM3(*axis, 'X', 'Y', 'Z') && axis[1]=='\0')){
-               PyErr_SetString(PyExc_TypeError, "euler.rotate(): expected axis to be 'X', 'Y' or 'Z'");
+               PyErr_SetString(PyExc_TypeError, "euler.rotate(): "
+                               "expected axis to be 'X', 'Y' or 'Z'");
                return NULL;
        }
 
@@ -360,7 +367,9 @@ static PyObject *Euler_item(EulerObject * self, int i)
        if(i<0) i= EULER_SIZE-i;
 
        if(i < 0 || i >= EULER_SIZE) {
-               PyErr_SetString(PyExc_IndexError, "euler[attribute]: array index out of range");
+               PyErr_SetString(PyExc_IndexError,
+                               "euler[attribute]: "
+                               "array index out of range");
                return NULL;
        }
 
@@ -377,14 +386,18 @@ static int Euler_ass_item(EulerObject * self, int i, PyObject *value)
        float f = PyFloat_AsDouble(value);
 
        if(f == -1 && PyErr_Occurred()) { // parsed item not a number
-               PyErr_SetString(PyExc_TypeError, "euler[attribute] = x: argument not a number");
+               PyErr_SetString(PyExc_TypeError,
+                               "euler[attribute] = x: "
+                               "argument not a number");
                return -1;
        }
 
        if(i<0) i= EULER_SIZE-i;
 
        if(i < 0 || i >= EULER_SIZE){
-               PyErr_SetString(PyExc_IndexError, "euler[attribute] = x: array assignment index out of range");
+               PyErr_SetString(PyExc_IndexError,
+                               "euler[attribute] = x: "
+                               "array assignment index out of range");
                return -1;
        }
 
@@ -436,7 +449,9 @@ static int Euler_ass_slice(EulerObject *self, int begin, int end, PyObject *seq)
                return -1;
 
        if(size != (end - begin)){
-               PyErr_SetString(PyExc_TypeError, "euler[begin:end] = []: size mismatch in slice assignment");
+               PyErr_SetString(PyExc_TypeError,
+                               "euler[begin:end] = []: "
+                               "size mismatch in slice assignment");
                return -1;
        }
 
@@ -471,12 +486,15 @@ static PyObject *Euler_subscript(EulerObject *self, PyObject *item)
                        return Euler_slice(self, start, stop);
                }
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with eulers");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with eulers");
                        return NULL;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "euler indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "euler indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return NULL;
        }
 }
@@ -501,12 +519,15 @@ static int Euler_ass_subscript(EulerObject *self, PyObject *item, PyObject *valu
                if (step == 1)
                        return Euler_ass_slice(self, start, stop, value);
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with euler");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with euler");
                        return -1;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "euler indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "euler indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return -1;
        }
 }
@@ -680,7 +701,8 @@ PyObject *newEulerObject(float *eul, short order, int type, PyTypeObject *base_t
                        self->wrapped = Py_NEW;
                }
                else {
-                       PyErr_SetString(PyExc_RuntimeError, "Euler(): invalid type");
+                       PyErr_SetString(PyExc_RuntimeError,
+                                       "Euler(): invalid type, internal error");
                        return NULL;
                }
 
index bed7dd12f083a9ecfe6dfe25ca684ad054dc96e5..4343485bb3aedecd6aab3687139b3e588b010909 100644 (file)
@@ -119,7 +119,9 @@ Mathutils_Callback mathutils_matrix_vector_cb = {
 static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
        if(kwds && PyDict_Size(kwds)) {
-               PyErr_SetString(PyExc_TypeError, "mathutils.Matrix(): takes no keyword args");
+               PyErr_SetString(PyExc_TypeError,
+                               "mathutils.Matrix(): "
+                               "takes no keyword args");
                return NULL;
        }
 
@@ -130,7 +132,8 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
                {
                        PyObject *arg= PyTuple_GET_ITEM(args, 0);
 
-                       const unsigned short row_size= PySequence_Size(arg); /* -1 is an error, size checks will accunt for this */
+                       /* -1 is an error, size checks will accunt for this */
+                       const unsigned short row_size= PySequence_Size(arg);
 
                        if(row_size >= 2 && row_size <= 4) {
                                PyObject *item= PySequence_GetItem(arg, 0);
@@ -152,7 +155,9 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
        }
 
        /* will overwrite error */
-       PyErr_SetString(PyExc_TypeError, "mathutils.Matrix(): expects no args or 2-4 numeric sequences");
+       PyErr_SetString(PyExc_TypeError,
+                       "mathutils.Matrix(): "
+                       "expects no args or 2-4 numeric sequences");
        return NULL;
 }
 
@@ -211,14 +216,19 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
                0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
 
        if(!PyArg_ParseTuple(args, "di|O", &angle, &matSize, &vec)) {
-               PyErr_SetString(PyExc_TypeError, "mathutils.RotationMatrix(angle, size, axis): expected float int and a string or vector");
+               PyErr_SetString(PyExc_TypeError,
+                               "mathutils.RotationMatrix(angle, size, axis): "
+                               "expected float int and a string or vector");
                return NULL;
        }
 
        if(vec && PyUnicode_Check(vec)) {
                axis= _PyUnicode_AsString((PyObject *)vec);
                if(axis==NULL || axis[0]=='\0' || axis[1]!='\0' || axis[0] < 'X' || axis[0] > 'Z') {
-                       PyErr_SetString(PyExc_TypeError, "mathutils.RotationMatrix(): 3rd argument axis value must be a 3D vector or a string in 'X', 'Y', 'Z'");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "mathutils.RotationMatrix(): "
+                                       "3rd argument axis value must be a 3D vector "
+                                       "or a string in 'X', 'Y', 'Z'");
                        return NULL;
                }
                else {
@@ -230,15 +240,21 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
        angle= angle_wrap_rad(angle);
 
        if(matSize != 2 && matSize != 3 && matSize != 4) {
-               PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "mathutils.RotationMatrix(): "
+                               "can only return a 2x2 3x3 or 4x4 matrix");
                return NULL;
        }
        if(matSize == 2 && (vec != NULL)) {
-               PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): cannot create a 2x2 rotation matrix around arbitrary axis");
+               PyErr_SetString(PyExc_AttributeError,
+                               "mathutils.RotationMatrix(): "
+                               "cannot create a 2x2 rotation matrix around arbitrary axis");
                return NULL;
        }
        if((matSize == 3 || matSize == 4) && (axis == NULL) && (vec == NULL)) {
-               PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): axis of rotation for 3d and 4d matrices is required");
+               PyErr_SetString(PyExc_AttributeError,
+                               "mathutils.RotationMatrix(): "
+                               "axis of rotation for 3d and 4d matrices is required");
                return NULL;
        }
 
@@ -284,7 +300,8 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
        }
        else {
                /* should never get here */
-               PyErr_SetString(PyExc_AttributeError, "mathutils.RotationMatrix(): unknown error");
+               PyErr_SetString(PyExc_AttributeError,
+                               "mathutils.RotationMatrix(): unknown error");
                return NULL;
        }
 
@@ -348,7 +365,9 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
                return NULL;
        }
        if(matSize != 2 && matSize != 3 && matSize != 4) {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.Scale(): can only return a 2x2 3x3 or 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Matrix.Scale(): "
+                               "can only return a 2x2 3x3 or 4x4 matrix");
                return NULL;
        }
        if(vec) {
@@ -361,7 +380,8 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
                if(matSize == 2) {
                        mat[0] = factor;
                        mat[3] = factor;
-               } else {
+               }
+               else {
                        mat[0] = factor;
                        mat[4] = factor;
                        mat[8] = factor;
@@ -383,7 +403,8 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
                        mat[1] =     ((factor - 1) *(tvec[0] * tvec[1]));
                        mat[2] =     ((factor - 1) *(tvec[0] * tvec[1]));
                        mat[3] = 1 + ((factor - 1) *(tvec[1] * tvec[1]));
-               } else {
+               }
+               else {
                        mat[0] = 1 + ((factor - 1) *(tvec[0] * tvec[0]));
                        mat[1] =     ((factor - 1) *(tvec[0] * tvec[1]));
                        mat[2] =     ((factor - 1) *(tvec[0] * tvec[2]));
@@ -430,7 +451,9 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
                return NULL;
        }
        if(matSize != 2 && matSize != 3 && matSize != 4) {
-               PyErr_SetString(PyExc_AttributeError,"mathutils.Matrix.OrthoProjection(): can only return a 2x2 3x3 or 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "mathutils.Matrix.OrthoProjection(): "
+                               "can only return a 2x2 3x3 or 4x4 matrix");
                return NULL;
        }
 
@@ -445,7 +468,10 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
                                mat[3]= 1.0f;
                        }
                        else {
-                               PyErr_Format(PyExc_ValueError, "mathutils.Matrix.OrthoProjection(): unknown plane, expected: X, Y, not '%.200s'", plane);
+                               PyErr_Format(PyExc_ValueError,
+                                            "mathutils.Matrix.OrthoProjection(): "
+                                            "unknown plane, expected: X, Y, not '%.200s'",
+                                            plane);
                                return NULL;
                        }
                }
@@ -463,7 +489,10 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
                                mat[8]= 1.0f;
                        }
                        else {
-                               PyErr_Format(PyExc_ValueError, "mathutils.Matrix.OrthoProjection(): unknown plane, expected: XY, XZ, YZ, not '%.200s'", plane);
+                               PyErr_Format(PyExc_ValueError,
+                                            "mathutils.Matrix.OrthoProjection(): "
+                                            "unknown plane, expected: XY, XZ, YZ, not '%.200s'",
+                                            plane);
                                return NULL;
                        }
                }
@@ -539,7 +568,9 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
                return NULL;
        }
        if(matSize != 2 && matSize != 3 && matSize != 4) {
-               PyErr_SetString(PyExc_AttributeError,"mathutils.Matrix.Shear(): can only return a 2x2 3x3 or 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "mathutils.Matrix.Shear(): "
+                               "can only return a 2x2 3x3 or 4x4 matrix");
                return NULL;
        }
 
@@ -547,7 +578,9 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
                float const factor= PyFloat_AsDouble(fac);
 
                if(factor==-1.0f && PyErr_Occurred()) {
-                       PyErr_SetString(PyExc_AttributeError, "mathutils.Matrix.Shear(): the factor to be a float");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "mathutils.Matrix.Shear(): "
+                                       "the factor to be a float");
                        return NULL;
                }
 
@@ -562,7 +595,9 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
                        mat[1] = factor;
                }
                else {
-                       PyErr_SetString(PyExc_AttributeError, "Matrix.Shear(): expected: X, Y or wrong matrix size for shearing plane");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "Matrix.Shear(): "
+                                       "expected: X, Y or wrong matrix size for shearing plane");
                        return NULL;
                }
        }
@@ -592,7 +627,9 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
                        mat[2] = factor[1];
                }
                else {
-                       PyErr_SetString(PyExc_AttributeError, "mathutils.Matrix.Shear(): expected: X, Y, XY, XZ, YZ");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "mathutils.Matrix.Shear(): "
+                                       "expected: X, Y, XY, XZ, YZ");
                        return NULL;
                }
        }
@@ -624,7 +661,8 @@ static float matrix_determinant_internal(MatrixObject *self)
                                         self->matrix[1][1], self->matrix[1][2],
                                         self->matrix[2][0], self->matrix[2][1],
                                         self->matrix[2][2]);
-       } else {
+       }
+       else {
                return determinant_m4((float (*)[4])self->contigPtr);
        }
 }
@@ -648,7 +686,9 @@ static PyObject *Matrix_to_quaternion(MatrixObject *self)
 
        /*must be 3-4 cols, 3-4 rows, square matrix*/
        if((self->col_size < 3) || (self->row_size < 3) || (self->col_size != self->row_size)) {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.to_quat(): inappropriate matrix size - expects 3x3 or 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.to_quat(): "
+                               "inappropriate matrix size - expects 3x3 or 4x4 matrix");
                return NULL;
        }
        if(self->col_size == 3){
@@ -661,7 +701,7 @@ static PyObject *Matrix_to_quaternion(MatrixObject *self)
        return newQuaternionObject(quat, Py_NEW, NULL);
 }
 
-/*---------------------------Matrix.toEuler() --------------------*/
+/*---------------------------matrix.toEuler() --------------------*/
 PyDoc_STRVAR(Matrix_to_euler_doc,
 ".. method:: to_euler(order, euler_compat)\n"
 "\n"
@@ -710,12 +750,14 @@ static PyObject *Matrix_to_euler(MatrixObject *self, PyObject *args)
                mat= tmat;
        }
        else {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.to_euler(): inappropriate matrix size - expects 3x3 or 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.to_euler(): "
+                               "inappropriate matrix size - expects 3x3 or 4x4 matrix");
                return NULL;
        }
 
        if(order_str) {
-               order= euler_order_from_string(order_str, "Matrix.to_euler()");
+               order= euler_order_from_string(order_str, "matrix.to_euler()");
 
                if(order == -1)
                        return NULL;
@@ -743,17 +785,20 @@ static PyObject *Matrix_resize_4x4(MatrixObject *self)
        int x, first_row_elem, curr_pos, new_pos, blank_columns, blank_rows, index;
 
        if(self->wrapped==Py_WRAP){
-               PyErr_SetString(PyExc_TypeError, "cannot resize wrapped data - make a copy and resize that");
+               PyErr_SetString(PyExc_TypeError,
+                               "cannot resize wrapped data - make a copy and resize that");
                return NULL;
        }
        if(self->cb_user){
-               PyErr_SetString(PyExc_TypeError, "cannot resize owned data - make a copy and resize that");
+               PyErr_SetString(PyExc_TypeError,
+                               "cannot resize owned data - make a copy and resize that");
                return NULL;
        }
 
        self->contigPtr = PyMem_Realloc(self->contigPtr, (sizeof(float) * 16));
        if(self->contigPtr == NULL) {
-               PyErr_SetString(PyExc_MemoryError, "matrix.resize_4x4(): problem allocating pointer space");
+               PyErr_SetString(PyExc_MemoryError,
+                               "matrix.resize_4x4(): problem allocating pointer space");
                return NULL;
        }
        /*set row pointers*/
@@ -813,7 +858,8 @@ static PyObject *Matrix_to_4x4(MatrixObject *self)
        }
        /* TODO, 2x2 matrix */
 
-       PyErr_SetString(PyExc_TypeError, "Matrix.to_4x4(): inappropriate matrix size");
+       PyErr_SetString(PyExc_TypeError,
+                       "matrix.to_4x4(): inappropriate matrix size");
        return NULL;
 }
 
@@ -833,7 +879,8 @@ static PyObject *Matrix_to_3x3(MatrixObject *self)
                return NULL;
 
        if((self->col_size < 3) || (self->row_size < 3)) {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.to_3x3(): inappropriate matrix size");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.to_3x3(): inappropriate matrix size");
                return NULL;
        }
 
@@ -856,7 +903,9 @@ static PyObject *Matrix_to_translation(MatrixObject *self)
                return NULL;
 
        if((self->col_size < 3) || self->row_size < 4){
-               PyErr_SetString(PyExc_AttributeError, "Matrix.to_translation(): inappropriate matrix size");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.to_translation(): "
+                               "inappropriate matrix size");
                return NULL;
        }
 
@@ -884,7 +933,9 @@ static PyObject *Matrix_to_scale(MatrixObject *self)
 
        /*must be 3-4 cols, 3-4 rows, square matrix*/
        if((self->col_size < 3) || (self->row_size < 3)) {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.to_scale(): inappropriate matrix size, 3x3 minimum size");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.to_scale(): "
+                               "inappropriate matrix size, 3x3 minimum size");
                return NULL;
        }
 
@@ -896,7 +947,7 @@ static PyObject *Matrix_to_scale(MatrixObject *self)
        return newVectorObject(size, 3, Py_NEW, NULL);
 }
 
-/*---------------------------Matrix.invert() ---------------------*/
+/*---------------------------matrix.invert() ---------------------*/
 PyDoc_STRVAR(Matrix_invert_doc,
 ".. method:: invert()\n"
 "\n"
@@ -918,7 +969,9 @@ static PyObject *Matrix_invert(MatrixObject *self)
                return NULL;
 
        if(self->row_size != self->col_size){
-               PyErr_SetString(PyExc_AttributeError, "Matrix.invert(ed): only square matrices are supported");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.invert(ed): "
+                               "only square matrices are supported");
                return NULL;
        }
 
@@ -950,8 +1003,10 @@ static PyObject *Matrix_invert(MatrixObject *self)
                }
                /*transpose
                Matrix_transpose(self);*/
-       } else {
-               PyErr_SetString(PyExc_ValueError, "matrix does not have an inverse");
+       }
+       else {
+               PyErr_SetString(PyExc_ValueError,
+                               "matrix does not have an inverse");
                return NULL;
        }
 
@@ -995,7 +1050,8 @@ static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value)
                return NULL;
 
        if(self->col_size != 3 || self->row_size != 3) {
-               PyErr_SetString(PyExc_ValueError, "Matrix must have 3x3 dimensions");
+               PyErr_SetString(PyExc_ValueError,
+                               "Matrix must have 3x3 dimensions");
                return NULL;
        }
 
@@ -1008,7 +1064,7 @@ static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value)
        Py_RETURN_NONE;
 }
 
-/*---------------------------Matrix.decompose() ---------------------*/
+/*---------------------------matrix.decompose() ---------------------*/
 PyDoc_STRVAR(Matrix_decompose_doc,
 ".. method:: decompose()\n"
 "\n"
@@ -1026,7 +1082,9 @@ static PyObject *Matrix_decompose(MatrixObject *self)
        float size[3];
 
        if(self->col_size != 4 || self->row_size != 4) {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.decompose(): inappropriate matrix size - expects 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.decompose(): "
+                               "inappropriate matrix size - expects 4x4 matrix");
                return NULL;
        }
 
@@ -1067,7 +1125,9 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args)
                return NULL;
 
        if(self->row_size != mat2->row_size || self->col_size != mat2->col_size) {
-               PyErr_SetString(PyExc_AttributeError, "matrix.lerp(): expects both matrix objects of the same dimensions");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.lerp(): "
+                               "expects both matrix objects of the same dimensions");
                return NULL;
        }
 
@@ -1082,14 +1142,16 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args)
                blend_m3_m3m3((float (*)[3])mat, (float (*)[3])self->contigPtr, (float (*)[3])mat2->contigPtr, fac);
        }
        else {
-               PyErr_SetString(PyExc_AttributeError, "matrix.lerp(): only 3x3 and 4x4 matrices supported");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.lerp(): "
+                               "only 3x3 and 4x4 matrices supported");
                return NULL;
        }
 
        return (PyObject*)newMatrixObject(mat, self->row_size, self->col_size, Py_NEW, Py_TYPE(self));
 }
 
-/*---------------------------Matrix.determinant() ----------------*/
+/*---------------------------matrix.determinant() ----------------*/
 PyDoc_STRVAR(Matrix_determinant_doc,
 ".. method:: determinant()\n"
 "\n"
@@ -1106,13 +1168,15 @@ static PyObject *Matrix_determinant(MatrixObject *self)
                return NULL;
 
        if(self->row_size != self->col_size){
-               PyErr_SetString(PyExc_AttributeError, "Matrix.determinant: only square matrices are supported");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.determinant: "
+                               "only square matrices are supported");
                return NULL;
        }
 
        return PyFloat_FromDouble((double)matrix_determinant_internal(self));
 }
-/*---------------------------Matrix.transpose() ------------------*/
+/*---------------------------matrix.transpose() ------------------*/
 PyDoc_STRVAR(Matrix_transpose_doc,
 ".. method:: transpose()\n"
 "\n"
@@ -1128,7 +1192,9 @@ static PyObject *Matrix_transpose(MatrixObject *self)
                return NULL;
 
        if(self->row_size != self->col_size){
-               PyErr_SetString(PyExc_AttributeError, "Matrix.transpose(d): only square matrices are supported");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.transpose(d): "
+                               "only square matrices are supported");
                return NULL;
        }
 
@@ -1138,7 +1204,8 @@ static PyObject *Matrix_transpose(MatrixObject *self)
                self->matrix[0][1] = t;
        } else if(self->row_size == 3) {
                transpose_m3((float (*)[3])self->contigPtr);
-       } else {
+       }
+       else {
                transpose_m4((float (*)[4])self->contigPtr);
        }
 
@@ -1159,7 +1226,7 @@ static PyObject *Matrix_transposed(MatrixObject *self)
        return matrix__apply_to_copy((PyNoArgsFunction)Matrix_transpose, self);
 }
 
-/*---------------------------Matrix.zero() -----------------------*/
+/*---------------------------matrix.zero() -----------------------*/
 PyDoc_STRVAR(Matrix_zero_doc,
 ".. method:: zero()\n"
 "\n"
@@ -1177,7 +1244,7 @@ static PyObject *Matrix_zero(MatrixObject *self)
 
        Py_RETURN_NONE;
 }
-/*---------------------------Matrix.identity(() ------------------*/
+/*---------------------------matrix.identity(() ------------------*/
 PyDoc_STRVAR(Matrix_identity_doc,
 ".. method:: identity()\n"
 "\n"
@@ -1194,7 +1261,9 @@ static PyObject *Matrix_identity(MatrixObject *self)
                return NULL;
 
        if(self->row_size != self->col_size){
-               PyErr_SetString(PyExc_AttributeError, "Matrix.identity: only square matrices are supported");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.identity: "
+                               "only square matrices are supported");
                return NULL;
        }
 
@@ -1205,7 +1274,8 @@ static PyObject *Matrix_identity(MatrixObject *self)
                self->matrix[1][1] = 1.0f;
        } else if(self->row_size == 3) {
                unit_m3((float (*)[3])self->contigPtr);
-       } else {
+       }
+       else {
                unit_m4((float (*)[4])self->contigPtr);
        }
 
@@ -1262,7 +1332,8 @@ static PyObject *Matrix_repr(MatrixObject *self)
                                                                                "       %R)", rows[0], rows[1], rows[2], rows[3]);
        }
 
-       PyErr_SetString(PyExc_RuntimeError, "invalid matrix size");
+       PyErr_SetString(PyExc_RuntimeError,
+                       "internal error!");
        return NULL;
 }
 
@@ -1321,7 +1392,9 @@ static PyObject *Matrix_item(MatrixObject *self, int i)
                return NULL;
 
        if(i < 0 || i >= self->row_size) {
-               PyErr_SetString(PyExc_IndexError, "matrix[attribute]: array index out of range");
+               PyErr_SetString(PyExc_IndexError,
+                               "matrix[attribute]: "
+                               "array index out of range");
                return NULL;
        }
        return newVectorObject_cb((PyObject *)self, self->col_size, mathutils_matrix_vector_cb_index, i);
@@ -1336,7 +1409,8 @@ static int Matrix_ass_item(MatrixObject *self, int i, PyObject *value)
                return -1;
 
        if(i >= self->row_size || i < 0){
-               PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: bad column");
+               PyErr_SetString(PyExc_TypeError,
+                               "matrix[attribute] = x: bad column");
                return -1;
        }
 
@@ -1399,7 +1473,9 @@ static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *va
 
                if(PySequence_Fast_GET_SIZE(value_fast) != size) {
                        Py_DECREF(value_fast);
-                       PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: size mismatch in slice assignment");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "matrix[begin:end] = []: "
+                                       "size mismatch in slice assignment");
                        return -1;
                }
 
@@ -1433,7 +1509,9 @@ static PyObject *Matrix_add(PyObject *m1, PyObject *m2)
        mat2 = (MatrixObject*)m2;
 
        if(!MatrixObject_Check(m1) || !MatrixObject_Check(m2)) {
-               PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Matrix addition: "
+                               "arguments not valid for this operation");
                return NULL;
        }
 
@@ -1441,7 +1519,9 @@ static PyObject *Matrix_add(PyObject *m1, PyObject *m2)
                return NULL;
 
        if(mat1->row_size != mat2->row_size || mat1->col_size != mat2->col_size){
-               PyErr_SetString(PyExc_AttributeError, "Matrix addition: matrices must have the same dimensions for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Matrix addition: "
+                               "matrices must have the same dimensions for this operation");
                return NULL;
        }
 
@@ -1460,7 +1540,9 @@ static PyObject *Matrix_sub(PyObject *m1, PyObject *m2)
        mat2 = (MatrixObject*)m2;
 
        if(!MatrixObject_Check(m1) || !MatrixObject_Check(m2)) {
-               PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Matrix addition: "
+                               "arguments not valid for this operation");
                return NULL;
        }
 
@@ -1468,7 +1550,9 @@ static PyObject *Matrix_sub(PyObject *m1, PyObject *m2)
                return NULL;
 
        if(mat1->row_size != mat2->row_size || mat1->col_size != mat2->col_size){
-               PyErr_SetString(PyExc_AttributeError, "Matrix addition: matrices must have the same dimensions for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Matrix addition: "
+                               "matrices must have the same dimensions for this operation");
                return NULL;
        }
 
@@ -1502,9 +1586,12 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2)
                        return NULL;
        }
 
-       if(mat1 && mat2) { /*MATRIX * MATRIX*/
+       if(mat1 && mat2) {
+               /*MATRIX * MATRIX*/
                if(mat1->row_size != mat2->col_size){
-                       PyErr_SetString(PyExc_AttributeError,"Matrix multiplication: matrix A rowsize must equal matrix B colsize");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "Matrix multiplication: "
+                                       "matrix A rowsize must equal matrix B colsize");
                        return NULL;
                }
                else {
@@ -1529,12 +1616,14 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2)
                }
        }
        else if(mat2) {
-               if (((scalar= PyFloat_AsDouble(m1)) == -1.0f && PyErr_Occurred())==0) { /*FLOAT/INT * MATRIX */
+               /*FLOAT/INT * MATRIX */
+               if (((scalar= PyFloat_AsDouble(m1)) == -1.0f && PyErr_Occurred())==0) {
                        return matrix_mul_float(mat2, scalar);
                }
        }
        else if(mat1) {
-               if (((scalar= PyFloat_AsDouble(m2)) == -1.0f && PyErr_Occurred())==0) { /*FLOAT/INT * MATRIX */
+               /*FLOAT/INT * MATRIX */
+               if (((scalar= PyFloat_AsDouble(m2)) == -1.0f && PyErr_Occurred())==0) {
                        return matrix_mul_float(mat1, scalar);
                }
        }
@@ -1542,7 +1631,10 @@ static PyObject *Matrix_mul(PyObject *m1, PyObject *m2)
                BLI_assert(!"internal error");
        }
 
-       PyErr_Format(PyExc_TypeError, "Matrix multiplication: not supported between '%.200s' and '%.200s' types", Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
+       PyErr_Format(PyExc_TypeError,
+                    "Matrix multiplication: "
+                    "not supported between '%.200s' and '%.200s' types",
+                    Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
        return NULL;
 }
 static PyObject* Matrix_inv(MatrixObject *self)
@@ -1591,12 +1683,15 @@ static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item)
                        return Matrix_slice(self, start, stop);
                }
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with matricies");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with matricies");
                        return NULL;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "vector indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "vector indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return NULL;
        }
 }
@@ -1620,12 +1715,15 @@ static int Matrix_ass_subscript(MatrixObject* self, PyObject* item, PyObject* va
                if (step == 1)
                        return Matrix_ass_slice(self, start, stop, value);
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with matricies");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with matricies");
                        return -1;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "matrix indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "matrix indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return -1;
        }
 }
@@ -1693,7 +1791,9 @@ static PyObject *Matrix_median_scale_get(MatrixObject *self, void *UNUSED(closur
 
        /*must be 3-4 cols, 3-4 rows, square matrix*/
        if((self->col_size < 3) || (self->row_size < 3)) {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.median_scale: inappropriate matrix size, 3x3 minimum");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.median_scale: "
+                               "inappropriate matrix size, 3x3 minimum");
                return NULL;
        }
 
@@ -1713,7 +1813,9 @@ static PyObject *Matrix_is_negative_get(MatrixObject *self, void *UNUSED(closure
        else if(self->col_size == 3 && self->row_size == 3)
                return PyBool_FromLong(is_negative_m3((float (*)[3])self->contigPtr));
        else {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.is_negative: inappropriate matrix size - expects 3x3 or 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.is_negative: "
+                               "inappropriate matrix size - expects 3x3 or 4x4 matrix");
                return NULL;
        }
 }
@@ -1729,7 +1831,9 @@ static PyObject *Matrix_is_orthogonal_get(MatrixObject *self, void *UNUSED(closu
        else if(self->col_size == 3 && self->row_size == 3)
                return PyBool_FromLong(is_orthogonal_m3((float (*)[3])self->contigPtr));
        else {
-               PyErr_SetString(PyExc_AttributeError, "Matrix.is_orthogonal: inappropriate matrix size - expects 3x3 or 4x4 matrix");
+               PyErr_SetString(PyExc_AttributeError,
+                               "matrix.is_orthogonal: "
+                               "inappropriate matrix size - expects 3x3 or 4x4 matrix");
                return NULL;
        }
 }
@@ -1865,7 +1969,9 @@ PyObject *newMatrixObject(float *mat, const unsigned short rowSize, const unsign
 
        /*matrix objects can be any 2-4row x 2-4col matrix*/
        if(rowSize < 2 || rowSize > 4 || colSize < 2 || colSize > 4) {
-               PyErr_SetString(PyExc_RuntimeError, "matrix(): row and column sizes must be between 2 and 4");
+               PyErr_SetString(PyExc_RuntimeError,
+                               "Matrix(): "
+                               "row and column sizes must be between 2 and 4");
                return NULL;
        }
 
@@ -1891,7 +1997,9 @@ PyObject *newMatrixObject(float *mat, const unsigned short rowSize, const unsign
                else if (type == Py_NEW){
                        self->contigPtr = PyMem_Malloc(rowSize * colSize * sizeof(float));
                        if(self->contigPtr == NULL) { /*allocation failure*/
-                               PyErr_SetString(PyExc_MemoryError, "matrix(): problem allocating pointer space");
+                               PyErr_SetString(PyExc_MemoryError,
+                                               "Matrix(): "
+                                               "problem allocating pointer space");
                                return NULL;
                        }
                        /*pointer array points to contigous memory*/
@@ -1913,7 +2021,8 @@ PyObject *newMatrixObject(float *mat, const unsigned short rowSize, const unsign
                        self->wrapped = Py_NEW;
                }
                else {
-                       PyErr_SetString(PyExc_RuntimeError, "Matrix(): invalid type");
+                       PyErr_SetString(PyExc_RuntimeError,
+                                       "Matrix(): invalid type, internal error");
                        return NULL;
                }
        }
index 90447e7093ae913be145810f8062d6a723524c30..977ff7ccbc77f6b53d577465a5877f9b263f2d01 100644 (file)
@@ -235,7 +235,9 @@ static PyObject *Quaternion_slerp(QuaternionObject *self, PyObject *args)
        float tquat[QUAT_SIZE], quat[QUAT_SIZE], fac;
 
        if(!PyArg_ParseTuple(args, "Of:slerp", &value, &fac)) {
-               PyErr_SetString(PyExc_TypeError, "quat.slerp(): expected Quaternion types and float");
+               PyErr_SetString(PyExc_TypeError,
+                               "quat.slerp(): "
+                               "expected Quaternion types and float");
                return NULL;
        }
 
@@ -246,7 +248,9 @@ static PyObject *Quaternion_slerp(QuaternionObject *self, PyObject *args)
                return NULL;
 
        if(fac > 1.0f || fac < 0.0f) {
-               PyErr_SetString(PyExc_AttributeError, "quat.slerp(): interpolation factor must be between 0.0 and 1.0");
+               PyErr_SetString(PyExc_AttributeError,
+                               "quat.slerp(): "
+                               "interpolation factor must be between 0.0 and 1.0");
                return NULL;
        }
 
@@ -498,7 +502,9 @@ static PyObject *Quaternion_item(QuaternionObject *self, int i)
        if(i<0) i= QUAT_SIZE-i;
 
        if(i < 0 || i >= QUAT_SIZE) {
-               PyErr_SetString(PyExc_IndexError, "quaternion[attribute]: array index out of range");
+               PyErr_SetString(PyExc_IndexError,
+                               "quaternion[attribute]: "
+                               "array index out of range");
                return NULL;
        }
 
@@ -514,14 +520,18 @@ static int Quaternion_ass_item(QuaternionObject *self, int i, PyObject *ob)
 {
        float scalar= (float)PyFloat_AsDouble(ob);
        if(scalar==-1.0f && PyErr_Occurred()) { /* parsed item not a number */
-               PyErr_SetString(PyExc_TypeError, "quaternion[index] = x: index argument not a number");
+               PyErr_SetString(PyExc_TypeError,
+                               "quaternion[index] = x: "
+                               "index argument not a number");
                return -1;
        }
 
        if(i<0) i= QUAT_SIZE-i;
 
        if(i < 0 || i >= QUAT_SIZE){
-               PyErr_SetString(PyExc_IndexError, "quaternion[attribute] = x: array assignment index out of range");
+               PyErr_SetString(PyExc_IndexError,
+                               "quaternion[attribute] = x: "
+                               "array assignment index out of range");
                return -1;
        }
        self->quat[i] = scalar;
@@ -572,7 +582,9 @@ static int Quaternion_ass_slice(QuaternionObject *self, int begin, int end, PyOb
                return -1;
 
        if(size != (end - begin)){
-               PyErr_SetString(PyExc_TypeError, "quaternion[begin:end] = []: size mismatch in slice assignment");
+               PyErr_SetString(PyExc_TypeError,
+                               "quaternion[begin:end] = []: "
+                               "size mismatch in slice assignment");
                return -1;
        }
 
@@ -608,12 +620,15 @@ static PyObject *Quaternion_subscript(QuaternionObject *self, PyObject *item)
                        return Quaternion_slice(self, start, stop);
                }
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with quaternions");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with quaternions");
                        return NULL;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "quaternion indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "quaternion indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return NULL;
        }
 }
@@ -638,12 +653,15 @@ static int Quaternion_ass_subscript(QuaternionObject *self, PyObject *item, PyOb
                if (step == 1)
                        return Quaternion_ass_slice(self, start, stop, value);
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with quaternion");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with quaternion");
                        return -1;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "quaternion indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "quaternion indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return -1;
        }
 }
@@ -657,7 +675,9 @@ static PyObject *Quaternion_add(PyObject *q1, PyObject *q2)
        QuaternionObject *quat1 = NULL, *quat2 = NULL;
 
        if(!QuaternionObject_Check(q1) || !QuaternionObject_Check(q2)) {
-               PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Quaternion addition: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        quat1 = (QuaternionObject*)q1;
@@ -678,7 +698,9 @@ static PyObject *Quaternion_sub(PyObject *q1, PyObject *q2)
        QuaternionObject *quat1 = NULL, *quat2 = NULL;
 
        if(!QuaternionObject_Check(q1) || !QuaternionObject_Check(q2)) {
-               PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Quaternion addition: "
+                               "arguments not valid for this operation");
                return NULL;
        }
 
@@ -740,7 +762,10 @@ static PyObject *Quaternion_mul(PyObject *q1, PyObject *q2)
                BLI_assert(!"internal error");
        }
 
-       PyErr_Format(PyExc_TypeError, "Quaternion multiplication: not supported between '%.200s' and '%.200s' types", Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
+       PyErr_Format(PyExc_TypeError,
+                    "Quaternion multiplication: "
+                    "not supported between '%.200s' and '%.200s' types",
+                    Py_TYPE(q1)->tp_name, Py_TYPE(q2)->tp_name);
        return NULL;
 }
 
@@ -861,7 +886,8 @@ static int Quaternion_setAngle(QuaternionObject *self, PyObject *value, void *UN
        angle= PyFloat_AsDouble(value);
 
        if(angle==-1.0 && PyErr_Occurred()) { /* parsed item not a number */
-               PyErr_SetString(PyExc_TypeError, "quaternion.angle = value: float expected");
+               PyErr_SetString(PyExc_TypeError,
+                               "quaternion.angle = value: float expected");
                return -1;
        }
 
@@ -942,7 +968,9 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw
        float quat[QUAT_SIZE]= {0.0f, 0.0f, 0.0f, 0.0f};
 
        if(kwds && PyDict_Size(kwds)) {
-               PyErr_SetString(PyExc_TypeError, "mathutils.Quaternion(): takes no keyword args");
+               PyErr_SetString(PyExc_TypeError,
+                               "mathutils.Quaternion(): "
+                               "takes no keyword args");
                return NULL;
        }
 
@@ -1114,7 +1142,8 @@ PyObject *newQuaternionObject(float *quat, int type, PyTypeObject *base_type)
                        self->wrapped = Py_NEW;
                }
                else {
-                       PyErr_SetString(PyExc_RuntimeError, "Quaternion(): invalid type");
+                       PyErr_SetString(PyExc_RuntimeError,
+                                       "Quaternion(): invalid type, internal error");
                        return NULL;
                }
        }
index e07b51c9e4bea4b2cfc675b7e5cfdef5dfbe26a9..b8fdc2f0890a7d15cd4edfe8aab4bbabe6fd5342 100644 (file)
@@ -66,7 +66,9 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED
                        return NULL;
                break;
        default:
-               PyErr_SetString(PyExc_TypeError, "mathutils.Vector(): more then a single arg given");
+               PyErr_SetString(PyExc_TypeError,
+                               "mathutils.Vector(): "
+                               "more then a single arg given");
                return NULL;
        }
        return newVectorObject(vec, size, Py_NEW, type);
@@ -156,17 +158,23 @@ PyDoc_STRVAR(Vector_resize_2d_doc,
 static PyObject *Vector_resize_2d(VectorObject *self)
 {
        if(self->wrapped==Py_WRAP) {
-               PyErr_SetString(PyExc_TypeError, "vector.resize_2d(): cannot resize wrapped data - only python vectors");
+               PyErr_SetString(PyExc_TypeError,
+                               "vector.resize_2d(): "
+                               "cannot resize wrapped data - only python vectors");
                return NULL;
        }
        if(self->cb_user) {
-               PyErr_SetString(PyExc_TypeError, "vector.resize_2d(): cannot resize a vector that has an owner");
+               PyErr_SetString(PyExc_TypeError,
+                               "vector.resize_2d(): "
+                               "cannot resize a vector that has an owner");
                return NULL;
        }
 
        self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2));
        if(self->vec == NULL) {
-               PyErr_SetString(PyExc_MemoryError, "vector.resize_2d(): problem allocating pointer space");
+               PyErr_SetString(PyExc_MemoryError,
+                               "vector.resize_2d(): "
+                               "problem allocating pointer space");
                return NULL;
        }
 
@@ -185,17 +193,23 @@ PyDoc_STRVAR(Vector_resize_3d_doc,
 static PyObject *Vector_resize_3d(VectorObject *self)
 {
        if (self->wrapped==Py_WRAP) {
-               PyErr_SetString(PyExc_TypeError, "vector.resize_3d(): cannot resize wrapped data - only python vectors");
+               PyErr_SetString(PyExc_TypeError,
+                               "vector.resize_3d(): "
+                               "cannot resize wrapped data - only python vectors");
                return NULL;
        }
        if(self->cb_user) {
-               PyErr_SetString(PyExc_TypeError, "vector.resize_3d(): cannot resize a vector that has an owner");
+               PyErr_SetString(PyExc_TypeError,
+                               "vector.resize_3d(): "
+                               "cannot resize a vector that has an owner");
                return NULL;
        }
 
        self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3));
        if(self->vec == NULL) {
-               PyErr_SetString(PyExc_MemoryError, "vector.resize_3d(): problem allocating pointer space");
+               PyErr_SetString(PyExc_MemoryError,
+                               "vector.resize_3d(): "
+                               "problem allocating pointer space");
                return NULL;
        }
 
@@ -217,17 +231,23 @@ PyDoc_STRVAR(Vector_resize_4d_doc,
 static PyObject *Vector_resize_4d(VectorObject *self)
 {
        if(self->wrapped==Py_WRAP) {
-               PyErr_SetString(PyExc_TypeError, "vector.resize_4d(): cannot resize wrapped data - only python vectors");
+               PyErr_SetString(PyExc_TypeError,
+                               "vector.resize_4d(): "
+                               "cannot resize wrapped data - only python vectors");
                return NULL;
        }
        if(self->cb_user) {
-               PyErr_SetString(PyExc_TypeError, "vector.resize_4d(): cannot resize a vector that has an owner");
+               PyErr_SetString(PyExc_TypeError,
+                               "vector.resize_4d(): "
+                               "cannot resize a vector that has an owner");
                return NULL;
        }
 
        self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4));
        if(self->vec == NULL) {
-               PyErr_SetString(PyExc_MemoryError, "vector.resize_4d(): problem allocating pointer space");
+               PyErr_SetString(PyExc_MemoryError,
+                               "vector.resize_4d(): "
+                               "problem allocating pointer space");
                return NULL;
        }
 
@@ -333,7 +353,9 @@ static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
                return NULL;
 
        if(ndigits > 22 || ndigits < 0) {
-               PyErr_SetString(PyExc_ValueError, "vector.to_tuple(ndigits): ndigits must be between 0 and 21");
+               PyErr_SetString(PyExc_ValueError,
+                               "vector.to_tuple(ndigits): "
+                               "ndigits must be between 0 and 21");
                return NULL;
        }
 
@@ -368,7 +390,9 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
                return NULL;
 
        if (self->size != 3) {
-               PyErr_SetString(PyExc_TypeError, "only for 3D vectors");
+               PyErr_SetString(PyExc_TypeError,
+                               "vector.to_track_quat(): "
+                               "only for 3D vectors");
                return NULL;
        }
 
@@ -376,6 +400,8 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
                return NULL;
 
        if (strack) {
+               const char *axis_err_msg= "only X, -X, Y, -Y, Z or -Z for track axis";
+
                if (strlen(strack) == 2) {
                        if (strack[0] == '-') {
                                switch(strack[1]) {
@@ -389,12 +415,12 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
                                                track = 5;
                                                break;
                                        default:
-                                               PyErr_SetString(PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis");
+                                               PyErr_SetString(PyExc_ValueError, axis_err_msg);
                                                return NULL;
                                }
                        }
                        else {
-                               PyErr_SetString(PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis");
+                               PyErr_SetString(PyExc_ValueError, axis_err_msg);
                                return NULL;
                        }
                }
@@ -411,17 +437,19 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
                                track = 2;
                                break;
                        default:
-                               PyErr_SetString(PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis");
+                               PyErr_SetString(PyExc_ValueError, axis_err_msg);
                                return NULL;
                        }
                }
                else {
-                       PyErr_SetString(PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis");
+                       PyErr_SetString(PyExc_ValueError,
+                                       axis_err_msg);
                        return NULL;
                }
        }
 
        if (sup) {
+               const char *axis_err_msg= "only X, Y or Z for up axis";
                if (strlen(sup) == 1) {
                        switch(*sup) {
                        case 'X':
@@ -434,18 +462,19 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
                                up = 2;
                                break;
                        default:
-                               PyErr_SetString(PyExc_ValueError, "only X, Y or Z for up axis");
+                               PyErr_SetString(PyExc_ValueError, axis_err_msg);
                                return NULL;
                        }
                }
                else {
-                       PyErr_SetString(PyExc_ValueError, "only X, Y or Z for up axis");
+                       PyErr_SetString(PyExc_ValueError, axis_err_msg);
                        return NULL;
                }
        }
 
        if (track == up) {
-               PyErr_SetString(PyExc_ValueError, "Can't have the same axis for track and up");
+               PyErr_SetString(PyExc_ValueError,
+                               "Can't have the same axis for track and up");
                return NULL;
        }
 
@@ -604,7 +633,9 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
                        return fallback;
                }
                else {
-                       PyErr_SetString(PyExc_ValueError, "vector.angle(other): zero length vectors have no valid angle");
+                       PyErr_SetString(PyExc_ValueError,
+                                       "vector.angle(other): "
+                                       "zero length vectors have no valid angle");
                        return NULL;
                }
        }
@@ -636,7 +667,9 @@ static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
        float quat[4], vec_a[3], vec_b[3];
 
        if(self->size < 3) {
-               PyErr_SetString(PyExc_AttributeError, "vec.difference(value): expects both vectors to be size 3 or 4");
+               PyErr_SetString(PyExc_AttributeError,
+                               "vec.difference(value): "
+                               "expects both vectors to be size 3 or 4");
                return NULL;
        }
 
@@ -750,7 +783,8 @@ static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
                return NULL;
 
        if(self->size < 3) {
-               PyErr_SetString(PyExc_ValueError, "Vector must be 3D or 4D");
+               PyErr_SetString(PyExc_ValueError,
+                               "Vector must be 3D or 4D");
                return NULL;
        }
 
@@ -804,8 +838,15 @@ static PyObject *vector_item_internal(VectorObject *self, int i, const int is_at
        if(i<0) i= self->size-i;
 
        if(i < 0 || i >= self->size) {
-               if(is_attr)     PyErr_Format(PyExc_AttributeError,"vector.%c: unavailable on %dd vector", *(((char *)"xyzw") + i), self->size);
-               else            PyErr_SetString(PyExc_IndexError,"vector[index]: out of range");
+               if(is_attr)     {
+                       PyErr_Format(PyExc_AttributeError,
+                                    "vector.%c: unavailable on %dd vector",
+                                    *(((char *)"xyzw") + i), self->size);
+               }
+               else {
+                       PyErr_SetString(PyExc_IndexError,
+                                       "vector[index]: out of range");
+               }
                return NULL;
        }
 
@@ -824,15 +865,25 @@ static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value,
 {
        float scalar;
        if((scalar=PyFloat_AsDouble(value))==-1.0f && PyErr_Occurred()) { /* parsed item not a number */
-               PyErr_SetString(PyExc_TypeError, "vector[index] = x: index argument not a number");
+               PyErr_SetString(PyExc_TypeError,
+                               "vector[index] = x: "
+                               "index argument not a number");
                return -1;
        }
 
        if(i<0) i= self->size-i;
 
        if(i < 0 || i >= self->size){
-               if(is_attr)     PyErr_Format(PyExc_AttributeError,"vector.%c = x: unavailable on %dd vector", *(((char *)"xyzw") + i), self->size);
-               else            PyErr_SetString(PyExc_IndexError, "vector[index] = x: assignment index out of range");
+               if(is_attr) {
+                       PyErr_Format(PyExc_AttributeError,
+                                    "vector.%c = x: unavailable on %dd vector",
+                                    *(((char *)"xyzw") + i), self->size);
+               }
+               else {
+                       PyErr_SetString(PyExc_IndexError,
+                                       "vector[index] = x: "
+                                       "assignment index out of range");
+               }
                return -1;
        }
        self->vec[i] = scalar;
@@ -904,7 +955,9 @@ static PyObject *Vector_add(PyObject *v1, PyObject *v2)
        float vec[MAX_DIMENSIONS];
 
        if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
-               PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector addition: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        vec1 = (VectorObject*)v1;
@@ -915,7 +968,9 @@ static PyObject *Vector_add(PyObject *v1, PyObject *v2)
 
        /*VECTOR + VECTOR*/
        if(vec1->size != vec2->size) {
-               PyErr_SetString(PyExc_AttributeError, "Vector addition: vectors must have the same dimensions for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector addition: "
+                               "vectors must have the same dimensions for this operation");
                return NULL;
        }
 
@@ -930,14 +985,18 @@ static PyObject *Vector_iadd(PyObject *v1, PyObject *v2)
        VectorObject *vec1 = NULL, *vec2 = NULL;
 
        if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
-               PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector addition: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        vec1 = (VectorObject*)v1;
        vec2 = (VectorObject*)v2;
 
        if(vec1->size != vec2->size) {
-               PyErr_SetString(PyExc_AttributeError, "Vector addition: vectors must have the same dimensions for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector addition: "
+                               "vectors must have the same dimensions for this operation");
                return NULL;
        }
 
@@ -958,7 +1017,9 @@ static PyObject *Vector_sub(PyObject *v1, PyObject *v2)
        float vec[MAX_DIMENSIONS];
 
        if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
-               PyErr_SetString(PyExc_AttributeError, "Vector subtraction: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector subtraction: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        vec1 = (VectorObject*)v1;
@@ -968,7 +1029,9 @@ static PyObject *Vector_sub(PyObject *v1, PyObject *v2)
                return NULL;
 
        if(vec1->size != vec2->size) {
-               PyErr_SetString(PyExc_AttributeError, "Vector subtraction: vectors must have the same dimensions for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector subtraction: "
+                               "vectors must have the same dimensions for this operation");
                return NULL;
        }
 
@@ -983,14 +1046,18 @@ static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
        VectorObject *vec1= NULL, *vec2= NULL;
 
        if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) {
-               PyErr_SetString(PyExc_AttributeError, "Vector subtraction: arguments not valid for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector subtraction: "
+                               "arguments not valid for this operation");
                return NULL;
        }
        vec1 = (VectorObject*)v1;
        vec2 = (VectorObject*)v2;
 
        if(vec1->size != vec2->size) {
-               PyErr_SetString(PyExc_AttributeError, "Vector subtraction: vectors must have the same dimensions for this operation");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector subtraction: "
+                               "vectors must have the same dimensions for this operation");
                return NULL;
        }
 
@@ -1027,7 +1094,10 @@ static int column_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject
                        vec_cpy[3] = 1.0f;
                }
                else {
-                       PyErr_SetString(PyExc_AttributeError, "matrix * vector: matrix.row_size and len(vector) must be the same, except for 3D vector * 4x4 matrix.");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "matrix * vector: "
+                                       "matrix.row_size and len(vector) must be the same, "
+                                       "except for 3D vector * 4x4 matrix.");
                        return -1;
                }
        }
@@ -1077,7 +1147,9 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
                double dot = 0.0f;
 
                if(vec1->size != vec2->size) {
-                       PyErr_SetString(PyExc_AttributeError, "Vector multiplication: vectors must have the same dimensions for this operation");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "Vector multiplication: "
+                                       "vectors must have the same dimensions for this operation");
                        return NULL;
                }
 
@@ -1105,7 +1177,9 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
                        float tvec[3];
 
                        if(vec1->size != 3) {
-                               PyErr_SetString(PyExc_TypeError, "Vector multiplication: only 3D vector rotations (with quats) currently supported");
+                               PyErr_SetString(PyExc_TypeError,
+                                               "Vector multiplication: "
+                                               "only 3D vector rotations (with quats) currently supported");
                                return NULL;
                        }
                        if(BaseMath_ReadCallback(quat2) == -1) {
@@ -1128,7 +1202,10 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
                BLI_assert(!"internal error");
        }
 
-       PyErr_Format(PyExc_TypeError, "Vector multiplication: not supported between '%.200s' and '%.200s' types", Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
+       PyErr_Format(PyExc_TypeError,
+                    "Vector multiplication: "
+                    "not supported between '%.200s' and '%.200s' types",
+                    Py_TYPE(v1)->tp_name, Py_TYPE(v2)->tp_name);
        return NULL;
 }
 
@@ -1158,7 +1235,9 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
                QuaternionObject *quat2 = (QuaternionObject*)v2;
 
                if(vec->size != 3) {
-                       PyErr_SetString(PyExc_TypeError, "Vector multiplication: only 3D vector rotations (with quats) currently supported");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "Vector multiplication: "
+                                       "only 3D vector rotations (with quats) currently supported");
                        return NULL;
                }
 
@@ -1171,7 +1250,9 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
                mul_vn_fl(vec->vec, vec->size, scalar);
        }
        else {
-               PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation");
+               PyErr_SetString(PyExc_TypeError,
+                               "Vector multiplication: "
+                               "arguments not acceptable for this operation");
                return NULL;
        }
 
@@ -1188,7 +1269,9 @@ static PyObject *Vector_div(PyObject *v1, PyObject *v2)
        VectorObject *vec1 = NULL;
 
        if(!VectorObject_Check(v1)) { /* not a vector */
-               PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float");
+               PyErr_SetString(PyExc_TypeError,
+                               "Vector division: "
+                               "Vector must be divided by a float");
                return NULL;
        }
        vec1 = (VectorObject*)v1; /* vector */
@@ -1197,12 +1280,16 @@ static PyObject *Vector_div(PyObject *v1, PyObject *v2)
                return NULL;
 
        if((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
-               PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float");
+               PyErr_SetString(PyExc_TypeError,
+                               "Vector division: "
+                               "Vector must be divided by a float");
                return NULL;
        }
 
        if(scalar==0.0f) {
-               PyErr_SetString(PyExc_ZeroDivisionError, "Vector division: divide by zero error");
+               PyErr_SetString(PyExc_ZeroDivisionError,
+                               "Vector division: "
+                               "divide by zero error");
                return NULL;
        }
 
@@ -1223,12 +1310,16 @@ static PyObject *Vector_idiv(PyObject *v1, PyObject *v2)
                return NULL;
 
        if((scalar=PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) { /* parsed item not a number */
-               PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float");
+               PyErr_SetString(PyExc_TypeError,
+                               "Vector division: "
+                               "Vector must be divided by a float");
                return NULL;
        }
 
        if(scalar==0.0f) {
-               PyErr_SetString(PyExc_ZeroDivisionError, "Vector division: divide by zero error");
+               PyErr_SetString(PyExc_ZeroDivisionError,
+                               "Vector division: "
+                               "divide by zero error");
                return NULL;
        }
        for(i = 0; i < vec1->size; i++) {
@@ -1394,12 +1485,15 @@ static PyObject *Vector_subscript(VectorObject* self, PyObject* item)
                        return Vector_slice(self, start, stop);
                }
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with vectors");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with vectors");
                        return NULL;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "vector indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "vector indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return NULL;
        }
 }
@@ -1423,12 +1517,15 @@ static int Vector_ass_subscript(VectorObject* self, PyObject* item, PyObject* va
                if (step == 1)
                        return Vector_ass_slice(self, start, stop, value);
                else {
-                       PyErr_SetString(PyExc_TypeError, "slice steps not supported with vectors");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "slice steps not supported with vectors");
                        return -1;
                }
        }
        else {
-               PyErr_Format(PyExc_TypeError, "vector indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
+               PyErr_Format(PyExc_TypeError,
+                            "vector indices must be integers, not %.200s",
+                            Py_TYPE(item)->tp_name);
                return -1;
        }
 }
@@ -1517,12 +1614,14 @@ static int Vector_setLength(VectorObject *self, PyObject *value)
                return -1;
 
        if((param=PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred()) {
-               PyErr_SetString(PyExc_TypeError, "length must be set to a number");
+               PyErr_SetString(PyExc_TypeError,
+                               "length must be set to a number");
                return -1;
        }
 
        if (param < 0.0) {
-               PyErr_SetString(PyExc_TypeError, "cannot set a vectors length to a negative value");
+               PyErr_SetString(PyExc_TypeError,
+                               "cannot set a vectors length to a negative value");
                return -1;
        }
        if (param == 0.0) {
@@ -1573,7 +1672,9 @@ static PyObject *Vector_getSwizzle(VectorObject *self, void *closure)
        {
                axis_from = swizzleClosure & SWIZZLE_AXIS;
                if(axis_from >= self->size) {
-                       PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "Vector swizzle: "
+                                       "specified axis not present");
                        return NULL;
                }
 
@@ -1615,12 +1716,13 @@ static int Vector_setSwizzle(VectorObject *self, PyObject *value, void *closure)
           swizzles defined for axes z and w, but they would be invalid. */
        swizzleClosure = GET_INT_FROM_POINTER(closure);
        axis_from= 0;
-       while (swizzleClosure & SWIZZLE_VALID_AXIS)
-       {
+       while (swizzleClosure & SWIZZLE_VALID_AXIS) {
                axis_to = swizzleClosure & SWIZZLE_AXIS;
                if (axis_to >= self->size)
                {
-                       PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "Vector swizzle: "
+                                       "specified axis not present");
                        return -1;
                }
                swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS;
@@ -1639,7 +1741,8 @@ static int Vector_setSwizzle(VectorObject *self, PyObject *value, void *closure)
        }
 
        if(axis_from != size_from) {
-               PyErr_SetString(PyExc_AttributeError, "Error: vector size does not match swizzle");
+               PyErr_SetString(PyExc_AttributeError,
+                               "Vector swizzle: size does not match swizzle");
                return -1;
        }
 
@@ -2071,7 +2174,9 @@ static int row_vector_multiplication(float rvec[4], VectorObject* vec, MatrixObj
 
        if(mat->colSize != vec_size){
                if(mat->colSize == 4 && vec_size != 3){
-                       PyErr_SetString(PyExc_AttributeError, "vector * matrix: matrix column size and the vector size must be the same");
+                       PyErr_SetString(PyExc_AttributeError,
+                                       "vector * matrix: matrix column size "
+                                       "and the vector size must be the same");
                        return -1;
                }
                else {
@@ -2252,7 +2357,8 @@ PyObject *newVectorObject(float *vec, const int size, const int type, PyTypeObje
        VectorObject *self;
 
        if(size > 4 || size < 2) {
-               PyErr_SetString(PyExc_RuntimeError, "Vector(): invalid size");
+               PyErr_SetString(PyExc_RuntimeError,
+                               "Vector(): invalid size");
                return NULL;
        }
 
@@ -2284,7 +2390,8 @@ PyObject *newVectorObject(float *vec, const int size, const int type, PyTypeObje
                        self->wrapped = Py_NEW;
                }
                else {
-                       PyErr_SetString(PyExc_RuntimeError, "Vector(): invalid type");
+                       PyErr_SetString(PyExc_RuntimeError,
+                                       "Vector(): invalid type, internal error");
                        return NULL;
                }
        }
index 26844a5003d6bdcb8c1a2e8b3d6cb23d5f5bc905..601daf01d00b7b41315d45d22862903017c8ddac 100644 (file)
@@ -90,7 +90,8 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject*
                return NULL;
        }
        if(vec1->size != 3 || vec2->size != 3 || vec3->size != 3 || ray->size != 3 || ray_off->size != 3) {
-               PyErr_SetString(PyExc_ValueError, "only 3D vectors for all parameters");
+               PyErr_SetString(PyExc_ValueError,
+                               "only 3D vectors for all parameters");
                return NULL;
        }
 
@@ -177,7 +178,8 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
                return NULL;
        }
        if(vec1->size != vec2->size || vec1->size != vec3->size || vec3->size != vec2->size) {
-               PyErr_SetString(PyExc_ValueError,"vectors must be of the same size");
+               PyErr_SetString(PyExc_ValueError,
+                               "vectors must be of the same size");
                return NULL;
        }
 
@@ -225,7 +227,8 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
                }
        }
        else {
-               PyErr_SetString(PyExc_ValueError, "2D/3D vectors only");
+               PyErr_SetString(PyExc_ValueError,
+                               "2D/3D vectors only");
                return NULL;
        }
 }
@@ -259,11 +262,13 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject* args)
                        return NULL;
                }
                if(vec1->size != vec2->size || vec1->size != vec3->size) {
-                       PyErr_SetString(PyExc_ValueError, "vectors must be of the same size");
+                       PyErr_SetString(PyExc_ValueError,
+                                       "vectors must be of the same size");
                        return NULL;
                }
                if(vec1->size < 3) {
-                       PyErr_SetString(PyExc_ValueError, "2D vectors unsupported");
+                       PyErr_SetString(PyExc_ValueError,
+                                       "2D vectors unsupported");
                        return NULL;
                }
 
@@ -277,11 +282,13 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject* args)
                        return NULL;
                }
                if(vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec4->size) {
-                       PyErr_SetString(PyExc_ValueError,"vectors must be of the same size");
+                       PyErr_SetString(PyExc_ValueError,
+                                       "vectors must be of the same size");
                        return NULL;
                }
                if(vec1->size < 3) {
-                       PyErr_SetString(PyExc_ValueError, "2D vectors unsupported");
+                       PyErr_SetString(PyExc_ValueError,
+                                       "2D vectors unsupported");
                        return NULL;
                }
 
@@ -318,7 +325,8 @@ static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject* args)
        }
 
        if(vec1->size != vec2->size || vec1->size != vec3->size) {
-               PyErr_SetString(PyExc_ValueError, "vectors must be of the same size");
+               PyErr_SetString(PyExc_ValueError,
+                               "vectors must be of the same size");
                return NULL;
        }
 
@@ -332,7 +340,8 @@ static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject* args)
                return PyFloat_FromDouble(area_tri_v2(vec1->vec, vec2->vec, vec3->vec));
        }
        else {
-               PyErr_SetString(PyExc_ValueError, "only 2D,3D vectors are supported");
+               PyErr_SetString(PyExc_ValueError,
+                               "only 2D,3D vectors are supported");
                return NULL;
        }
 }
@@ -360,7 +369,8 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
        int index, *dl_face, totpoints=0;
 
        if(!PySequence_Check(polyLineSeq)) {
-               PyErr_SetString(PyExc_TypeError, "expected a sequence of poly lines");
+               PyErr_SetString(PyExc_TypeError,
+                               "expected a sequence of poly lines");
                return NULL;
        }
        
@@ -371,7 +381,8 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
                if (!PySequence_Check(polyLine)) {
                        freedisplist(&dispbase);
                        Py_XDECREF(polyLine); /* may be null so use Py_XDECREF*/
-                       PyErr_SetString(PyExc_TypeError, "One or more of the polylines is not a sequence of mathutils.Vector's");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "One or more of the polylines is not a sequence of mathutils.Vector's");
                        return NULL;
                }
                
@@ -381,7 +392,8 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
                        if (EXPP_check_sequence_consistency(polyLine, &vector_Type) != 1) {
                                freedisplist(&dispbase);
                                Py_DECREF(polyLine);
-                               PyErr_SetString(PyExc_TypeError, "A point in one of the polylines is not a mathutils.Vector type");
+                               PyErr_SetString(PyExc_TypeError,
+                                               "A point in one of the polylines is not a mathutils.Vector type");
                                return NULL;
                        }
 #endif
@@ -422,7 +434,9 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
        
        if(ls_error) {
                freedisplist(&dispbase); /* possible some dl was allocated */
-               PyErr_SetString(PyExc_TypeError, "A point in one of the polylines is not a mathutils.Vector type");
+               PyErr_SetString(PyExc_TypeError,
+                               "A point in one of the polylines "
+                               "is not a mathutils.Vector type");
                return NULL;
        }
        else if (totpoints) {
@@ -436,7 +450,8 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
                tri_list= PyList_New(dl->parts);
                if(!tri_list) {
                        freedisplist(&dispbase);
-                       PyErr_SetString(PyExc_RuntimeError, "geometry.PolyFill failed to make a new list");
+                       PyErr_SetString(PyExc_RuntimeError,
+                                       "failed to make a new list");
                        return NULL;
                }
                
@@ -541,7 +556,9 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec
        }
 
        if(ELEM4(2, line_a->size, line_b->size, plane_co->size, plane_no->size)) {
-               PyErr_SetString(PyExc_RuntimeError, "geometry.intersect_line_plane(...) can't use 2D Vectors");
+               PyErr_SetString(PyExc_RuntimeError,
+                               "geometry.intersect_line_plane(...): "
+                               " can't use 2D Vectors");
                return NULL;
        }
 
@@ -597,7 +614,9 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
        }
 
        if(ELEM3(2, line_a->size, line_b->size, sphere_co->size)) {
-               PyErr_SetString(PyExc_RuntimeError, "geometry.intersect_line_sphere(...) can't use 2D Vectors");
+               PyErr_SetString(PyExc_RuntimeError,
+                               "geometry.intersect_line_sphere(...): "
+                               " can't use 2D Vectors");
                return NULL;
        }
        else {
@@ -834,7 +853,8 @@ static int boxPack_FromPyObject(PyObject *value, boxPack **boxarray)
        
        /* Error checking must already be done */
        if(!PyList_Check(value)) {
-               PyErr_SetString(PyExc_TypeError, "can only back a list of [x, y, w, h]");
+               PyErr_SetString(PyExc_TypeError,
+                               "can only back a list of [x, y, w, h]");
                return -1;
        }
        
@@ -847,7 +867,8 @@ static int boxPack_FromPyObject(PyObject *value, boxPack **boxarray)
                list_item= PyList_GET_ITEM(value, i);
                if(!PyList_Check(list_item) || PyList_Size(list_item) < 4) {
                        MEM_freeN(*boxarray);
-                       PyErr_SetString(PyExc_TypeError, "can only pack a list of [x, y, w, h]");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "can only pack a list of [x, y, w, h]");
                        return -1;
                }
                
@@ -862,7 +883,9 @@ static int boxPack_FromPyObject(PyObject *value, boxPack **boxarray)
 
                if (box->w < 0.0f || box->h < 0.0f) {
                        MEM_freeN(*boxarray);
-                       PyErr_SetString(PyExc_TypeError, "error parsing width and height values from list: [x, y, w, h], not numbers or below zero");
+                       PyErr_SetString(PyExc_TypeError,
+                                       "error parsing width and height values from list: "
+                                       "[x, y, w, h], not numbers or below zero");
                        return -1;
                }
 
@@ -906,7 +929,8 @@ static PyObject *M_Geometry_box_pack_2d(PyObject *UNUSED(self), PyObject *boxlis
        PyObject *ret;
        
        if(!PyList_Check(boxlist)) {
-               PyErr_SetString(PyExc_TypeError, "expected a list of boxes [[x, y, w, h], ... ]");
+               PyErr_SetString(PyExc_TypeError,
+                               "expected a list of boxes [[x, y, w, h], ... ]");
                return NULL;
        }
 
@@ -972,7 +996,8 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject*
        }
 
        if(resolu <= 1) {
-               PyErr_SetString(PyExc_ValueError, "resolution must be 2 or over");
+               PyErr_SetString(PyExc_ValueError,
+                               "resolution must be 2 or over");
                return NULL;
        }
 
@@ -1049,7 +1074,8 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje
                vec_t2_tar->size != 3 ||
                vec_t3_tar->size != 3)
        {
-               PyErr_SetString(PyExc_ValueError, "One of more of the vector arguments wasnt a 3D vector");
+               PyErr_SetString(PyExc_ValueError,
+                               "One of more of the vector arguments wasnt a 3D vector");
                return NULL;
        }