X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_2smeshpy.cxx;h=e8bc862a90dd119667e2afc63ddeaf5a8254f506;hp=17ee75746e49b91d4e0f02b86d1e43d47f08f01d;hb=5d0b75d9d1a9935ec419e820e6dde45a665dd978;hpb=6e5b6a69fafa1d8ea5be53f475e9558ec2211699 diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 17ee75746..e8bc862a9 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -686,6 +686,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand _AString indent = aCommand->GetIndentation(); _AString tryStr = indent + "try:"; _AString newCmd = indent + tab + ( aCommand->GetString().ToCString() + indent.Length() ); + _AString pasCmd = indent + tab + "pass"; // to keep valid if newCmd is erased _AString excStr = indent + "except:"; _AString msgStr = indent + "\tprint '"; msgStr += method + "() failed. Invalid file name?'"; @@ -693,6 +694,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand aCommand->Clear(); aCommand->GetString() = newCmd; aCommand->SetOrderNb( ++myNbCommands ); + myCommands.push_back( new _pyCommand( pasCmd, ++myNbCommands )); myCommands.push_back( new _pyCommand( excStr, ++myNbCommands )); myCommands.push_back( new _pyCommand( msgStr, ++myNbCommands )); }