diff --git a/src/Base/MatrixPy.xml b/src/Base/MatrixPy.xml index 2ab7326b2..6b231f913 100644 --- a/src/Base/MatrixPy.xml +++ b/src/Base/MatrixPy.xml @@ -233,7 +233,7 @@ Analyzes the type of transformation. The matrix elements - + public: MatrixPy(const Matrix4D & mat, PyTypeObject *T = &Type) diff --git a/src/Base/MatrixPyImp.cpp b/src/Base/MatrixPyImp.cpp index 5c7eda29c..f30ed7799 100644 --- a/src/Base/MatrixPyImp.cpp +++ b/src/Base/MatrixPyImp.cpp @@ -662,24 +662,24 @@ void MatrixPy::setA44(Py::Float arg) (*this->getMatrixPtr())[3][3] = (double)arg; } -Py::List MatrixPy::getA(void) const +Py::Sequence MatrixPy::getA(void) const { double mat[16]; this->getMatrixPtr()->getMatrix(mat); - Py::List list(16); + Py::Tuple tuple(16); for (int i=0; i<16; i++) { - list[i] = Py::Float(mat[i]); + tuple[i] = Py::Float(mat[i]); } - return list; + return tuple; } -void MatrixPy::setA(Py::List arg) +void MatrixPy::setA(Py::Sequence arg) { double mat[16]; this->getMatrixPtr()->getMatrix(mat); int index=0; - for (Py::List::iterator it = arg.begin(); it != arg.end() && index < 16; ++it) { + for (Py::Sequence::iterator it = arg.begin(); it != arg.end() && index < 16; ++it) { mat[index++] = (double)Py::Float(*it); } diff --git a/src/Mod/Points/App/PointsPyImp.cpp b/src/Mod/Points/App/PointsPyImp.cpp index b0b2819ac..bc87c7f15 100644 --- a/src/Mod/Points/App/PointsPyImp.cpp +++ b/src/Mod/Points/App/PointsPyImp.cpp @@ -135,15 +135,15 @@ PyObject* PointsPy::writeInventor(PyObject * args) PyObject* PointsPy::addPoints(PyObject * args) { PyObject *obj; - if (!PyArg_ParseTuple(args, "O!", &PyList_Type, &obj)) + if (!PyArg_ParseTuple(args, "O", &obj)) return 0; - Py::List list(obj); - union PyType_Object pyType = {&(Base::VectorPy::Type)}; - Py::Type vType(pyType.o); - try { - for (Py::List::iterator it = list.begin(); it != list.end(); ++it) { + Py::Sequence list(obj); + union PyType_Object pyType = {&(Base::VectorPy::Type)}; + Py::Type vType(pyType.o); + + for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { if ((*it).isType(vType)) { Py::Vector p(*it); getPointKernelPtr()->push_back(p.toVector());