diff options
author | Peter A. Bigot <pabigot@users.sourceforge.net> | 2010-05-28 18:57:49 -0500 |
---|---|---|
committer | Peter A. Bigot <pabigot@users.sourceforge.net> | 2010-05-28 18:57:49 -0500 |
commit | 952b3c65ee57f173315e1299822cad328e68e6ff (patch) | |
tree | 53482d50ea09739d673a6a26d81e7d4d84b60ed3 | |
parent | 863fda964a9bdbf43e8ea9b10cb9e19d3623099b (diff) |
Even better loop detection
-rw-r--r-- | pyxb/binding/content.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pyxb/binding/content.py b/pyxb/binding/content.py index 3c8cfca..ec54df3 100644 --- a/pyxb/binding/content.py +++ b/pyxb/binding/content.py @@ -499,7 +499,7 @@ class ElementUse (ContentState_mixin): self.setOrAppend(ctd, value) return True if element_use is not None: - print 'WARNING: Non-null EU does not match' + print 'WARNING: %s val %s eu %s does not match %s' % (ctd, value, element_use, self) return False assert not isinstance(value, xml.dom.Node) try: @@ -573,15 +573,13 @@ class StateStack (object): @return: C{True} iff the value was consumed by a transition.""" assert isinstance(ctd_instance, basis.complexTypeDefinition) #print 'SS ENTRY' - entry_top = self.topModelState() - have_tried = False + attempted = set() while 0 < len(self.__stack): top = self.topModelState() - # Stop with a failure if we're looping - if (top == entry_top) and have_tried: + if top in attempted: return False - have_tried = True + attempted.add(top) #print 'SSTop %s of %d on %s %s' % (top, len(self.__stack), value, element_use) try: ok = top.accepts(self, ctd_instance, value, element_use) |