From 6e1db67cc04022151b81caa40200ade3444a9d18 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Sat, 21 Jan 2006 06:21:03 +0000 Subject: [PATCH] ===Python API=== Bugfix: Hos discovered that recent fixes broke mesh.verts.extend(); it now accepts three floats again. Sorry.... --- source/blender/python/api2_2x/Mesh.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index 49d699174cf..91b86947a83 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -1609,17 +1609,21 @@ static PyObject *MVertSeq_extend( BPy_MVertSeq * self, PyObject *args ) } Py_INCREF( args ); /* so we can safely DECREF later */ break; - case 3: /* take any three args and put into a tuple */ + case 3: tmp = PyTuple_GET_ITEM( args, 0 ); - if( !PySequence_Check( tmp ) ) + /* if first item is not a number, it's wrong */ + if( !PyNumber_Check( tmp ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a sequence of sequence triplets" ); + + /* otherwise, put into a new tuple */ args = Py_BuildValue( "((OOO))", tmp, PyTuple_GET_ITEM( args, 1 ), PyTuple_GET_ITEM( args, 2 ) ); if( !args ) return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Py_BuildValue() failed" ); break; + default: /* anything else is definitely wrong */ return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a sequence of sequence triplets" );