From 51f3727d3c18318a161bce3b45163065db3cb262 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Tue, 17 May 2022 12:44:11 -0300 Subject: [PATCH] Sketcher: Use PyObject_IsTrue in combination with conditional ternary operator --- src/Mod/Sketcher/App/SketchObjectPyImp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp index eb598f56af..2219bf12be 100644 --- a/src/Mod/Sketcher/App/SketchObjectPyImp.cpp +++ b/src/Mod/Sketcher/App/SketchObjectPyImp.cpp @@ -1080,7 +1080,7 @@ PyObject* SketchObjectPy::fillet(PyObject *args) Base::Vector3d v1 = static_cast(pcObj1)->value(); Base::Vector3d v2 = static_cast(pcObj2)->value(); - if (this->getSketchObjectPtr()->fillet(geoId1, geoId2, v1, v2, radius, trim, PyObject_IsTrue(createCorner))) { + if (this->getSketchObjectPtr()->fillet(geoId1, geoId2, v1, v2, radius, trim, PyObject_IsTrue(createCorner) ? true : false)) { std::stringstream str; str << "Not able to fillet curves with ids : (" << geoId1 << ", " << geoId2 << ") and points (" << v1.x << ", " << v1.y << ", " << v1.z << ") & " << "(" << v2.x << ", " << v2.y << ", " << v2.z << ")"; @@ -1094,7 +1094,7 @@ PyObject* SketchObjectPy::fillet(PyObject *args) // Point, radius if (PyArg_ParseTuple(args, "iid|iO!", &geoId1, &posId1, &radius, &trim, &PyBool_Type, &createCorner)) { if (this->getSketchObjectPtr()->fillet(geoId1, (Sketcher::PointPos) posId1, radius, trim, - PyObject_IsTrue(createCorner))) { + PyObject_IsTrue(createCorner) ? true : false)) { std::stringstream str; str << "Not able to fillet point with ( geoId: " << geoId1 << ", PointPos: " << posId1 << " )"; PyErr_SetString(PyExc_ValueError, str.str().c_str());