From: rnv Date: Wed, 31 May 2017 15:15:36 +0000 (+0300) Subject: Python3 porting: adoptation SMESH dump python functionality. X-Git-Tag: V9_0_0~6^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=21c9336a4d74ec59fe881f6e436374c34e44fac7;p=modules%2Fsmesh.git Python3 porting: adoptation SMESH dump python functionality. --- diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index f3a0a556c..70f69c5d7 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -185,7 +185,7 @@ namespace { _AString comment; _pyID obj = cmd->GetObject(); - if ( obj.Search( "print " ) == 1 ) + if ( obj.Search( "print(" ) == 1 ) return; // print statement if ( !obj.IsEmpty() && obj.Value( obj.Length() ) == ')' ) @@ -688,7 +688,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand _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?'"; + _AString msgStr = indent + "\tprint('"; msgStr += method + "() failed. Invalid file name?')"; myCommands.insert( --myCommands.end(), new _pyCommand( tryStr, myNbCommands )); aCommand->Clear(); diff --git a/src/SMESH_I/SMESH_Pattern_i.cxx b/src/SMESH_I/SMESH_Pattern_i.cxx index ca5bcd0d2..4f36ddf40 100644 --- a/src/SMESH_I/SMESH_Pattern_i.cxx +++ b/src/SMESH_I/SMESH_Pattern_i.cxx @@ -58,7 +58,7 @@ using SMESH::TVar; static void addErrorCode(const char* thePyCommand) { TPythonDump() << "if (isDone != 1):"; - TPythonDump() << "\tprint '" << thePyCommand << " :', pattern.GetErrorCode()"; + TPythonDump() << "\tprint('" << thePyCommand << " :', pattern.GetErrorCode())"; } //=============================================================================