summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2010-06-17 22:47:21 +0200
committerThorsten Behrens <tbehrens@novell.com>2010-06-17 22:47:21 +0200
commit2371d6dd84fec8e3d4037e8b738e1e89c98678e7 (patch)
tree2afbb94d535321c02840a27e7d44d0236a7f670e
parent3808d880ab7ceb0ed618d2e3960cb40e31fdb10f (diff)
Slight tweaks
-rw-r--r--pyxb/binding/basis.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/pyxb/binding/basis.py b/pyxb/binding/basis.py
index 1246a1c..42b29ed 100644
--- a/pyxb/binding/basis.py
+++ b/pyxb/binding/basis.py
@@ -891,20 +891,17 @@ class simpleTypeDefinition (_TypeBinding_mixin, utility._DeconflictSymbols_mixin
@raise pyxb.BadTypeValueError: if any constraint is violated by trying to.
"""
facet_values = cls.__ClassFacetSequence.get(cls);
- value_= None
- i = 0
- while i < len(facet_values) and value_ is None:
+ for fac in facet_values
try:
- f = facet_values[i]
- val = f.iterateValue(value)
+ val = fac.iterateValue(value)
if val is not None and val != value:
cls.XsdConstraintsOK(val) #Adding complexity
value_ = val
+ break
except (pyxb.PyXBError, BaseException):
pass
- finally:
- i = i + 1
-
+
+ # TODO: nasty special case. can't we do that via polymorphism?
if value_ is None:
value_ = value._fuzz_vx(value)
cls.XsdConstraintsOK(value_)