From: Gilles DAVID Date: Wed, 29 Mar 2017 16:10:04 +0000 (+0200) Subject: [PY3] Fix exceptions and integers divisions X-Git-Tag: V9_0_0~5^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=17953b92fe75d00b2381d1912b247da2e3ca4d58;p=modules%2Fhomard.git [PY3] Fix exceptions and integers divisions --- diff --git a/src/tests/Test/test_4.py b/src/tests/Test/test_4.py index 90a0d280..452d455f 100755 --- a/src/tests/Test/test_4.py +++ b/src/tests/Test/test_4.py @@ -130,7 +130,7 @@ Python script for GEOM and SMESH box_m.ExportMED( ficmed, 0, SMESH.MED_V2_2, 1, None, 1) except Exception as eee: error = 2 - raise Exception('ExportToMEDX() failed. '+eee.message) + raise Exception('ExportToMEDX() failed. ' + str(eee)) # break # @@ -218,7 +218,7 @@ Python script for HOMARD hypo_4_1.AddZone('Zone_4_1', 1) hypo_4_1.SetExtraOutput(2) laux = hypo_4_1.GetZones() - nbzone = len(laux)/2 + nbzone = len(laux) // 2 jaux = 0 for iaux in range(nbzone) : print(hyponame_1, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux]) @@ -230,7 +230,7 @@ Python script for HOMARD hypo_4_2.AddZone('Zone_4_2', 1) hypo_4_2.SetExtraOutput(2) laux = hypo_4_2.GetZones() - nbzone = len(laux)/2 + nbzone = len(laux) // 2 jaux = 0 for iaux in range(nbzone) : print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux]) @@ -321,7 +321,7 @@ try : if ERROR : raise Exception('Pb in geom_smesh_exec') except Exception as eee: - raise Exception('Pb in geom_smesh_exec: '+eee.message) + raise Exception('Pb in geom_smesh_exec: ' + str(eee)) HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD') assert HOMARD is not None, "Impossible to load homard engine" @@ -334,7 +334,7 @@ try : if ERROR : raise Exception('Pb in homard_exec at iteration %d' %ERROR ) except Exception as eee: - raise Exception('Pb in homard_exec: '+eee.message) + raise Exception('Pb in homard_exec: ' + str(eee)) # # Test of the results #