PyTuple_Pack dosnt work with python 2.3 - removed
authorCampbell Barton <ideasman42@gmail.com>
Fri, 9 Nov 2007 15:56:41 +0000 (15:56 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 9 Nov 2007 15:56:41 +0000 (15:56 +0000)
source/blender/python/api2_2x/Geometry.c

index a3b2bc8b244726c2b3d7d2235c261b8209bbaf4e..f82117205db2aa6767d2f1b512b06ab72d4d7f54 100644 (file)
@@ -310,14 +310,9 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args
        /* do the calculation */
        lambda = lambda_cp_line_ex(pt_in, l1, l2, pt_out);
        
-       val1 = newVectorObject(pt_out, 3, Py_NEW);
-       val2 = PyFloat_FromDouble(lambda);
-       
-       ret = PyTuple_Pack(2, val1, val2);
-       
-       Py_DECREF(val1);
-       Py_DECREF(val2);
-       
+       PyTuple_New(2);
+       PyTuple_SET_ITEM( ret, 0, newVectorObject(pt_out, 3, Py_NEW) );
+       PyTuple_SET_ITEM( ret, 1, PyFloat_FromDouble(lambda) );
        return ret;
 }