From 551c946e0ee70cccfe93acc026b2f541e854e1d2 Mon Sep 17 00:00:00 2001 From: "yoann.audouin" Date: Thu, 4 Jan 2024 14:10:43 +0100 Subject: [PATCH] New method was not working when mesh was removed --- src/SMESH_I/SMESH_2smeshpy.cxx | 8 ++++++++ src/SMESH_I/SMESH_Gen_i.cxx | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index a45b96abf..c9ac03e24 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -1092,6 +1092,14 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) theCommand->RemoveArgs(); id_mesh->second->Process( theCommand ); id_mesh->second->AddProcessedCmd( theCommand ); + + // Changing command for compute adding a check on isDone and raising + // exception if not completed + _AString meshStr = theCommand->GetObject().ToCString(); + _AString excStr = "\"Could not compute mesh: \"+"; + excStr += meshStr + ".GetName()"; + _AString compStr = theCommand->GetString()+"\nif not isDone:\n\traise Exception("+excStr+")"; + theCommand->GetString() = compStr; return; } } diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 8d380c6da..88a3a4b2d 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2079,7 +2079,6 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, // Update Python script TPythonDump(this) << "isDone = " << this << ".Compute( " << theMesh << ", " << theShapeObject << ")"; - TPythonDump(this) << "if not isDone: \n raise Exception(\"Issue while computing Mesh\")"; try { // get mesh servant -- 2.39.2