From: vsr Date: Tue, 14 Jun 2011 07:29:30 +0000 (+0000) Subject: Fixed bug (from SALOME forum) in analytical curve creation - if the Python expression... X-Git-Tag: V6_3_1~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e905eeaff1e7421a302dd3fe3f65eab557319ae0;p=modules%2Fgeom.git Fixed bug (from SALOME forum) in analytical curve creation - if the Python expression is wrong, an error is printed; but even after re-entering valid expression, the function still does not work. --- diff --git a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx index 7fb4b5b29..329f4eec2 100644 --- a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx @@ -875,7 +875,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric(const char* aPyScript += thezExpr; aPyScript += "\n"; - aPyScript +="def coordCalucator(tmin, tmax, tstep): \n"; + aPyScript +="def coordCalculator(tmin, tmax, tstep): \n"; aPyScript +=" coords = [] \n"; aPyScript +=" while tmin <= tmax : \n"; aPyScript +=" coords.append([X(tmin), Y(tmin), Z(tmin)]) \n"; @@ -909,7 +909,8 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric(const char* PyObject* obj = PyRun_String(aPyScript.ToCString(), Py_file_input, main_dict, NULL); if (obj == NULL) { - SetErrorCode("Error during run python script !!!"); + SetErrorCode("Error during executing of python script !!!"); + PyErr_Print(); PyGILState_Release(gstate); return NULL; } else { @@ -917,7 +918,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric(const char* } PyObject * func = NULL; - func = PyObject_GetAttrString(main_mod, "coordCalucator"); + func = PyObject_GetAttrString(main_mod, "coordCalculator"); if (func == NULL){ SetErrorCode("Can't get function from python module !!!"); @@ -936,7 +937,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric(const char* PyErr_Print(); PySys_SetObject((char*)"stderr", PySys_GetObject((char*)"__stderr__")); Py_DECREF(new_stderr); - MESSAGE("Can't evaluate coordCalucator()" << " error is " << err_description); + MESSAGE("Can't evaluate coordCalculator()" << " error is " << err_description); SetErrorCode("Can't evaluate the expressions, please check them !!!"); PyGILState_Release(gstate); return NULL;