From b5ff8cdc822c87f502b0e77b5083099f70e5bf1b Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Thu, 21 May 2015 15:30:31 +0200 Subject: [PATCH] Sketcher Bug fix: Python function clear() contains wrong code ============================================================= This function is like this from 2011 according to git blame. The original code makes no sense. I assume that what is intended in this function (in accordance with SketchPy.xml) is call the method clear in Sketch.cpp. --- src/Mod/Sketcher/App/SketchPyImp.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchPyImp.cpp b/src/Mod/Sketcher/App/SketchPyImp.cpp index 3404a5dfb..39d72188a 100644 --- a/src/Mod/Sketcher/App/SketchPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchPyImp.cpp @@ -141,11 +141,9 @@ PyObject* SketchPy::addConstraint(PyObject *args) PyObject* SketchPy::clear(PyObject *args) { - int index; - if (!PyArg_ParseTuple(args, "i", &index)) - return 0; - - return Py::new_reference_to(Py::Int(getSketchPtr()->addVerticalConstraint(index))); + getSketchPtr()->clear(); + + Py_RETURN_NONE; } PyObject* SketchPy::movePoint(PyObject *args)