Salome HOME
Python3 porting: adoptation SMESH dump python functionality.
authorrnv <rnv@opencascade.com>
Wed, 31 May 2017 15:15:36 +0000 (18:15 +0300)
committerrnv <rnv@opencascade.com>
Wed, 31 May 2017 15:15:36 +0000 (18:15 +0300)
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_Pattern_i.cxx

index f3a0a556cf1f207d763f09df3900c39a2aa20d0a..70f69c5d797c0bb09bd257ae87e062a859b1770a 100644 (file)
@@ -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();
index ca5bcd0d2e0c74d85f482bd6e15242916996fef0..4f36ddf40966f9c149ec100388d2502cf56a1590 100644 (file)
@@ -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())";
 }
 
 //=============================================================================