Salome HOME
Porting to Python 3 (1st draft)
authorGilles DAVID <gilles-g.david@edf.fr>
Thu, 30 Mar 2017 12:43:29 +0000 (14:43 +0200)
committerGilles DAVID <gilles-g.david@edf.fr>
Thu, 30 Mar 2017 12:43:29 +0000 (14:43 +0200)
bin/createGroupsOnEntitiesFromGMFFile.py
src/HYBRIDPlugin/HYBRIDPluginBuilder.py

index c63f863efe9736c17ed0abba99444d8bafb4fd5c..bbd0a9d814d849240bb4f53c7de321e7ab22db69 100644 (file)
@@ -48,7 +48,7 @@ if the_mesh != None:
   yellow = SALOMEDS.Color(1,1,0)
 
   for i in dir(SMESH):
-    if "Entity_" in i: print i
+    if "Entity_" in i: print(i)
 
   entities = [("Tetra", SMESH.Entity_Tetra, blue), 
               ("Pyramid", SMESH.Entity_Pyramid, red), 
index c2ea69c23054b8428a194ef37444b6cb833449d0..682a48f1fb7af420ef41501899443671f4ded44c 100644 (file)
@@ -77,7 +77,7 @@ class HYBRID_Algorithm(Mesh_Algorithm):
     #              if it is @c 0 (default), the algorithm is assigned to the main shape
     def __init__(self, mesh, geom=0):
         Mesh_Algorithm.__init__(self)
-        if noHYBRIDPlugin: print "Warning: HYBRIDPlugin module unavailable"
+        if noHYBRIDPlugin: print("Warning: HYBRIDPlugin module unavailable")
         self.Create(mesh, geom, self.algoType, "libHYBRIDEngine.so")
         self.params = None
         pass
@@ -112,8 +112,7 @@ class HYBRID_Algorithm(Mesh_Algorithm):
                 for f in faces:
                     ids.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, f ))
             else:
-                raise TypeError, \
-                    "Face should be either ID or GEOM_Object, not %s" % type(fid)
+                raise TypeError("Face should be either ID or GEOM_Object, not %s" % type(fid))
             pass
         self.Parameters().SetFacesWithLayers(ids)
         if ids:
@@ -135,8 +134,7 @@ class HYBRID_Algorithm(Mesh_Algorithm):
                 for f in faces:
                     ids.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, f ))
             else:
-                raise TypeError, \
-                    "Face should be either ID or GEOM_Object, not %s" % type(fid)
+                raise TypeError("Face should be either ID or GEOM_Object, not %s" % type(fid))
             pass
         self.Parameters().SetFacesWithImprinting(ids)
         if ids: