Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-06-26 18:49:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-26 18:49:49 +0400
commite32c4677137b4915115de91306d2376d414dc326 (patch)
tree601f33912cb56e396df89570b1f78143f3451ce6 /source/blender/python/mathutils
parent00bbf5a72ff9b9816973fa6caf36ede912046bad (diff)
mathutils.Vector(kw=value) wasn't raising an error as it should.
Diffstat (limited to 'source/blender/python/mathutils')
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 8fb3a3f74d6..8c316807660 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -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));