Skip to content

Commit

Permalink
clear error state when creating spline
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Feb 18, 2017
1 parent 2209c7d commit 72375db
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Mod/Part/App/BSplineCurvePyImp.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 72375db

Please sign in to comment.