mathutils.Vector(kw=value) wasn't raising an error as it should.

This commit is contained in:
Campbell Barton 2012-06-26 14:49:49 +00:00
parent 00bbf5a72f
commit e32c467713

@ -54,11 +54,18 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
/* Supports 2D, 3D, and 4D vector objects both int and float values
* accepted. Mixed float and int values accepted. Ints are parsed to float
*/
static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
float *vec = NULL;
int size = 3; /* default to a 3D vector */
if (kwds && PyDict_Size(kwds)) {
PyErr_SetString(PyExc_TypeError,
"Vector(): "
"takes no keyword args");
return NULL;
}
switch (PyTuple_GET_SIZE(args)) {
case 0:
vec = PyMem_Malloc(size * sizeof(float));