Skip to content

Commit

Permalink
Ensure we only ever reparse *once*
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed May 4, 2016
1 parent 1d9f391 commit b0ae0c2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions html5lib/html5parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ def _parse(self, stream, innerHTML=False, container="div",
parser=self, **kwargs)
self.reset()

while True:
try:
self.mainLoop()
break
except ReparseException:
self.reset()
try:
self.mainLoop()
except ReparseException:
self.reset()
self.mainLoop()

def reset(self):
self.tree.reset()
Expand Down

0 comments on commit b0ae0c2

Please sign in to comment.