]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[Python 3] Minor fixes
authorNicolas Geimer <nicolas.geimer@edf.fr>
Wed, 19 Jul 2017 09:48:27 +0000 (11:48 +0200)
committerNicolas Geimer <nicolas.geimer@edf.fr>
Wed, 19 Jul 2017 09:48:27 +0000 (11:48 +0200)
bin/launchConfigureParser.py
src/Container/SALOME_Container.py
src/Container/SALOME_PyNode.py
src/SALOMESDS/TestSalomeSDSHelper0.py

index f5331d5d578c46f96f53b08295982d2a201f9e07..afe6045919a53ad0874f1f561aa7a14f6cf43c7f 100755 (executable)
@@ -111,8 +111,9 @@ def version():
         if root_dir and os.path.exists( version_file ):
             filename = version_file
         if filename:
-            str = open( filename, "r" ).readline() # str = "THIS IS SALOME - SALOMEGUI VERSION: 3.0.0"
-            match = re.search( r':\s+([a-zA-Z0-9.]+)\s*$', str )
+            with open(filename, "r") as f:
+                v = f.readline() # v = "THIS IS SALOME - SALOMEGUI VERSION: 3.0.0"
+            match = re.search( r':\s+([a-zA-Z0-9.]+)\s*$', v )
             if match :
                 return match.group( 1 )
     except:
index 08ca5cd935ffad4e639ceab730feb36fdca02df8..901f678a0225cf3082eb7b545ad64d8ce94c0849 100644 (file)
@@ -34,7 +34,6 @@
 
 import os
 import sys
-import string
 import traceback
 import imp
 from omniORB import CORBA, PortableServer
index 62cf5906f786f83e839d10441215bcf69b2f7f87..64ba692392e743c1618a67e74f55776cff6f05fd 100644 (file)
@@ -24,7 +24,7 @@
 #  Module : SALOME
 #  $Header$
 #
-import sys,traceback,string
+import sys,traceback
 import linecache
 import pickle
 import Engines__POA
@@ -58,7 +58,7 @@ class PyNode_i (Engines__POA.PyNode,Generic):
     self.nodeName=nodeName
     self.code=code
     self.my_container=my_container._container
-    linecache.cache[nodeName]=0,None,string.split(code,'\n'),nodeName
+    linecache.cache[nodeName]=0,None,code.split('\n'),nodeName
     ccode=compile(code,nodeName,'exec')
     self.context={}
     self.context["my_container"] = self.my_container
@@ -97,7 +97,7 @@ class PyScriptNode_i (Engines__POA.PyScriptNode,Generic):
     self.nodeName=nodeName
     self.code=code
     self.my_container=my_container._container
-    linecache.cache[nodeName]=0,None,string.split(code,'\n'),nodeName
+    linecache.cache[nodeName]=0,None,code.split('\n'),nodeName
     self.ccode=compile(code,nodeName,'exec')
     self.context={}
     self.context["my_container"] = self.my_container
index 87065447ff12988800faedd8c0fd7a4bccde73bf..7e447a8c4107edae883ce2f286e194cce6244040 100644 (file)
@@ -23,4 +23,4 @@ def waitKey():
     return str2Obj(dss.waitForMonoThrRev(wk))==[11,14,100]
 
 if __name__=="__main__":
-    sys.exit(not int(waitKey()))
+    sys.exit(not waitKey())