Salome HOME
In case of error in a Python InLineNode in the SuperVisionContainer, Kill_impl()...
authorrahuel <rahuel@opencascade.com>
Fri, 10 Dec 2004 13:07:52 +0000 (13:07 +0000)
committerrahuel <rahuel@opencascade.com>
Fri, 10 Dec 2004 13:07:52 +0000 (13:07 +0000)
Traces

src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx

index c22221d308e7ab12c6f0bfd8747acc1cc2d0cd26..75ca83c76f9e8042a0374328b0c8b90a1600901d 100644 (file)
@@ -615,20 +615,23 @@ PyObject * GraphExecutor::InNode::PyEvalCallObject( PyObject * MyPyRunMethod ,
     cdebug << pthread_self() << "PyEval_CallObject method beginning : " << Name() << endl ;
 //    Result = PyEval_CallObject( MyPyRunMethod , ArgsList ) ;
     Result = _OutNode->SuperVisionContainer()->ActivatePythonExecution( MyPyRunMethod , ArgsList ) ;
-    MESSAGE( pthread_self() << "PyEval_CallObject method finished." );
-    cdebug << pthread_self() << "PyEval_CallObject method finished." << endl ;
+    MESSAGE( pthread_self() << "PyEval_CallObject method finished. Result " << Result );
+    cdebug << pthread_self() << "PyEval_CallObject method finished. Result " << Result << endl ;
     cdebug_out << "Executor::InNode::PyEvalCallObject " << Name() << endl ;
   } catch( ... ) {
-    MESSAGE( pthread_self() << "ERROR: Exception caught PyEval_CallObject Python method." );
-    cdebug << pthread_self() << "ERROR: Exception caught PyEval_CallObject Python method."
-           << endl ;
-    MESSAGE( "       Python was reinitialized.  Previous Python definitions are lost Py_IsInitialized " << Py_IsInitialized() );
+    MESSAGE( pthread_self() << "ERROR: Exception caught PyEval_CallObject Python method. Result "  << Result );
+    cdebug << pthread_self() << "ERROR: Exception caught PyEval_CallObject Python method. Result "
+           << Result << endl ;
+//    MESSAGE( "       Python was reinitialized.  Previous Python definitions are lost Py_IsInitialized " << Py_IsInitialized() );
 //JR ===> fatal error in python : no current thread
 //    Py_Finalize();
 //    Py_Initialize();
 //    Automaton()->PyInitModule( false ) ;
 //    Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod );
 //    _OutNode->PyInitialized( false );
+    if ( Result == NULL ) {
+      Kill() ; // Reset of _ThreadId
+    }
     cdebug_out << "Executor::InNode::PyEvalCallObject ERROR catched " << Name()
                << " Py_IsInitialized " << Py_IsInitialized() << endl ;
   }