From: asv Date: Mon, 28 Feb 2005 12:00:20 +0000 (+0000) Subject: A fix for a bug was integrated. The bug: Python function (body) was changed, but... X-Git-Tag: V2_2_1rc~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f9632108a917a47ac7d656378d67faf69d4813fa;p=modules%2Fsuperv.git A fix for a bug was integrated. The bug: Python function (body) was changed, but Automation would return PyObject for OLD function. The fix is very simple and it is to be reviewed in the future: it is forced to re-automate the function (re-create PyObject) every time, always. --- diff --git a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx index 4a553e4..ee6ed21 100644 --- a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx +++ b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx @@ -155,7 +155,19 @@ PyObject * GraphExecutor::InNode::InitPyDynInvoke( char * PyFuncName , if ( strlen( PyFuncName ) ) { Automaton()->PyLock() ; + thePyRunMethod = Automaton()->PyFunction( PyFuncName ) ; + + thePyRunMethod = NULL; + // asv 28.02.05 : VERY BAD fix of the following problem: after change of a function, + // the changes are NOT taken into account by Automation - it returns PyObject of the OLD function. + // so here we force re-automating the PyObject EVERY TIME, regardless if the function has changed or not. + // Once again - it is a very bad solution, it fully discards the whole idea of automation, + // here is it done as a quick fix for a bug. + // A better solution (to be implemented): store the PyObject NOT in Automation map, but in + // InLine node itself! And if the method is changed - remove the PyObject and force to regenerate it. + // But this means that PyObject must be stored in Editor's data model. + if ( (*aPythonFunction).length() ) { if ( thePyRunMethod == NULL ) { unsigned int i ;