minor edits to exception formatting (remove ... or \n from suffix)
This commit is contained in:
@@ -138,12 +138,12 @@ static char Quaternion_Cross_doc[] =
|
||||
" :return: The cross product.\n"
|
||||
" :rtype: :class:`Quaternion`\n";
|
||||
|
||||
static PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * value)
|
||||
static PyObject *Quaternion_Cross(QuaternionObject *self, QuaternionObject *value)
|
||||
{
|
||||
float quat[QUAT_SIZE];
|
||||
|
||||
if (!QuaternionObject_Check(value)) {
|
||||
PyErr_SetString( PyExc_TypeError, "quat.cross(value): expected a quaternion argument" );
|
||||
PyErr_Format(PyExc_TypeError, "quat.cross(value): expected a quaternion argument, not %.200s", Py_TYPE(value)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ static char Quaternion_Dot_doc[] =
|
||||
static PyObject *Quaternion_Dot(QuaternionObject * self, QuaternionObject * value)
|
||||
{
|
||||
if (!QuaternionObject_Check(value)) {
|
||||
PyErr_SetString( PyExc_TypeError, "quat.dot(value): expected a quaternion argument" );
|
||||
PyErr_Format(PyExc_TypeError, "quat.dot(value): expected a quaternion argument, not %.200s", Py_TYPE(value)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ static PyObject *Quaternion_Difference(QuaternionObject * self, QuaternionObject
|
||||
float quat[QUAT_SIZE];
|
||||
|
||||
if (!QuaternionObject_Check(value)) {
|
||||
PyErr_SetString( PyExc_TypeError, "quat.difference(value): expected a quaternion argument" );
|
||||
PyErr_Format(PyExc_TypeError, "quat.difference(value): expected a quaternion argument, not %.200s", Py_TYPE(value)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ 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\n");
|
||||
PyErr_SetString(PyExc_IndexError, "quaternion[attribute]: array index out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -456,14 +456,14 @@ 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\n");
|
||||
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\n");
|
||||
PyErr_SetString(PyExc_IndexError, "quaternion[attribute] = x: array assignment index out of range");
|
||||
return -1;
|
||||
}
|
||||
self->quat[i] = scalar;
|
||||
@@ -604,7 +604,7 @@ 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....\n");
|
||||
PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation");
|
||||
return NULL;
|
||||
}
|
||||
quat1 = (QuaternionObject*)q1;
|
||||
@@ -625,7 +625,7 @@ 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....\n");
|
||||
PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -689,7 +689,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2)
|
||||
}
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n");
|
||||
PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user