From: eap Date: Tue, 4 Oct 2011 09:02:21 +0000 (+0000) Subject: in GetCriterion(), check enumeration type of Treshold and CritType X-Git-Tag: V6_4_0a1~60 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4fc70c1e1501cab7f56f2102f6e6376f0e786bb0;p=modules%2Fsmesh.git in GetCriterion(), check enumeration type of Treshold and CritType --- diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index d0b9e762a..805bb2dc0 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -796,6 +796,8 @@ class smeshDC(SMESH._objref_SMESH_Gen): UnaryOp=FT_Undefined, BinaryOp=FT_Undefined, Tolerance=1e-07): + if not CritType in SMESH.FunctorType._items: + raise TypeError, "CritType should be of SMESH.FunctorType" aCriterion = self.GetEmptyCriterion() aCriterion.TypeOfElement = elementType aCriterion.Type = self.EnumToLong(CritType) @@ -851,6 +853,7 @@ class smeshDC(SMESH._objref_SMESH_Gen): # Checks the treshold try: aCriterion.Threshold = self.EnumToLong(aTreshold) + assert( aTreshold in SMESH.GeometryType._items ) except: if isinstance(aTreshold, int): aCriterion.Threshold = aTreshold