diff --git a/src/Mod/Path/App/AppPathPy.cpp b/src/Mod/Path/App/AppPathPy.cpp index b1c5e481a3..0f3505e3d5 100644 --- a/src/Mod/Path/App/AppPathPy.cpp +++ b/src/Mod/Path/App/AppPathPy.cpp @@ -355,7 +355,7 @@ private: std::unique_ptr path(new Toolpath); Area::toPath(*path,shapes,start?&pstart:nullptr, &pend, PARAM_PY_FIELDS(PARAM_FARG,AREA_PARAMS_PATH)); - if (PyObject_IsTrue(return_end) ? false : true) + if (!Base::asBoolean(return_end)) return Py::asObject(new PathPy(path.release())); Py::Tuple tuple(2); tuple.setItem(0, Py::asObject(new PathPy(path.release()))); diff --git a/src/Mod/Path/App/AreaPyImp.cpp b/src/Mod/Path/App/AreaPyImp.cpp index 83bd71ea95..7832162193 100644 --- a/src/Mod/Path/App/AreaPyImp.cpp +++ b/src/Mod/Path/App/AreaPyImp.cpp @@ -39,7 +39,7 @@ static PyObject * areaAbort(PyObject *, PyObject *args, PyObject *kwd) { if (!PyArg_ParseTupleAndKeywords(args,kwd,"|O!",kwlist,&PyBool_Type,&pObj)) return nullptr; - Area::abort(PyObject_IsTrue(pObj) ? true : false); + Area::abort(Base::asBoolean(pObj)); Py_Return; } @@ -97,7 +97,7 @@ static PyObject * areaGetParamsDesc(PyObject *, PyObject *args, PyObject *kwd) { if (!PyArg_ParseTupleAndKeywords(args, kwd, "|O!",kwlist,&PyBool_Type,&pcObj)) return nullptr; - if (PyObject_IsTrue(pcObj) ? true : false) + if (Base::asBoolean(pcObj)) return PyUnicode_FromString(PARAM_PY_DOC(NAME,AREA_PARAMS_STATIC_CONF)); PyObject *dict = PyDict_New(); @@ -242,7 +242,7 @@ PyObject* AreaPy::getShape(PyObject *args, PyObject *keywds) return nullptr; PY_TRY { - if (PyObject_IsTrue(pcObj) ? true : false) + if (Base::asBoolean(pcObj)) getAreaPtr()->clean(); return Py::new_reference_to(Part::shape2pyshape(getAreaPtr()->getShape(index))); } PY_CATCH_OCC