From 21c9336a4d74ec59fe881f6e436374c34e44fac7 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 31 May 2017 18:15:36 +0300 Subject: [PATCH] Python3 porting: adoptation SMESH dump python functionality. --- src/SMESH_I/SMESH_2smeshpy.cxx | 4 ++-- src/SMESH_I/SMESH_Pattern_i.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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())"; } //============================================================================= -- 2.39.2