Salome HOME
[PY3] 2to3 results
[modules/smesh.git] / src / Tools / MGCleanerPlug / MGCleanerMonViewText.py
index 01c53069d800ac41fd37ef4e0ba6393f8e8ed5de..99e322d3111813d8c56f8c520653485f48c585e1 100644 (file)
@@ -91,7 +91,7 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog):
           f.write(cmds)
         self.make_executable(nomFichier)
         
-        if verbose: print("INFO: MGCleaner launch script file: %s" % nomFichier)
+        if verbose: print(("INFO: MGCleaner launch script file: %s" % nomFichier))
         
         self.monExe.start(nomFichier)
         self.monExe.closeWriteChannel()
@@ -108,23 +108,23 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog):
         savedir=os.environ['HOME']
         fn = QFileDialog.getSaveFileName(None, self.trUtf8("Save File"),savedir)
         if fn.isNull() : return
-        ulfile = os.path.abspath(unicode(fn))
+        ulfile = os.path.abspath(str(fn))
         try:
            f = open(fn, 'wb')
            f.write(str(self.TB_Exe.toPlainText()))
            f.close()
-        except IOError, why:
+        except IOError as why:
            QMessageBox.critical(self, self.trUtf8('Save File'),
                 self.trUtf8('The file <b>%1</b> could not be saved.<br>Reason: %2')
-                    .arg(unicode(fn)).arg(str(why)))
+                    .arg(str(fn)).arg(str(why)))
 
     def readFromStdErr(self):
         a=self.monExe.readAllStandardError()
-        self.TB_Exe.append(unicode(a.data()))
+        self.TB_Exe.append(str(a.data()))
 
     def readFromStdOut(self) :
         a=self.monExe.readAllStandardOutput()
-        aa=unicode(a.data())
+        aa=str(a.data())
         self.TB_Exe.append(aa)
     
     def finished(self):