From 72375db71bc87d0cc9239aaaddd15d1022718c46 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 18 Feb 2017 12:30:00 +0100 Subject: [PATCH] clear error state when creating spline --- src/Mod/Part/App/BSplineCurvePyImp.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Mod/Part/App/BSplineCurvePyImp.cpp b/src/Mod/Part/App/BSplineCurvePyImp.cpp index fd5de9641..1466707f4 100644 --- a/src/Mod/Part/App/BSplineCurvePyImp.cpp +++ b/src/Mod/Part/App/BSplineCurvePyImp.cpp @@ -71,21 +71,21 @@ int BSplineCurvePy::PyInit(PyObject* args, PyObject* /*kwd*/) return 0; } - PyObject* obj; - // poles, [ periodic, degree, interpolate ] - - obj = buildFromPoles(args); + PyErr_Clear(); + PyObject* obj; + // poles, [ periodic, degree, interpolate ] + obj = buildFromPoles(args); - if (obj) { - Py_DECREF(obj); - return 0; - } - else if (PyErr_ExceptionMatches(PartExceptionOCCError)) { - return -1; - } + if (obj) { + Py_DECREF(obj); + return 0; + } + else if (PyErr_ExceptionMatches(PartExceptionOCCError)) { + return -1; + } PyErr_SetString(PyExc_TypeError, "B-Spline constructor accepts:\n" - "-- poles, [ periodic, degree, interpolate ]\n" + "-- poles, [ periodic, degree, interpolate ]\n" "-- empty parameter list\n"); return -1; }