diff options
| author | Stefan Behnel <stefan_ml@behnel.de> | 2013-12-14 15:40:39 +0100 |
|---|---|---|
| committer | Stefan Behnel <stefan_ml@behnel.de> | 2013-12-14 15:40:39 +0100 |
| commit | 08a19872565a7f5806c683b88c22bc27b0307bcb (patch) | |
| tree | c837e7a0274ba7ad340e481191b34c06ea084f16 /src/lxml/parser.pxi | |
| parent | 56513d98015c22474e232bbebf101f51ef066e0e (diff) | |
| download | python-lxml-08a19872565a7f5806c683b88c22bc27b0307bcb.tar.gz | |
implement recover mode for pull parsers and iterparse
Diffstat (limited to 'src/lxml/parser.pxi')
| -rw-r--r-- | src/lxml/parser.pxi | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lxml/parser.pxi b/src/lxml/parser.pxi index 9d3730d3..b0ee0d6c 100644 --- a/src/lxml/parser.pxi +++ b/src/lxml/parser.pxi @@ -1225,6 +1225,12 @@ cdef class _FeedParser(_BaseParser): htmlparser.htmlParseChunk(pctxt, NULL, 0, 1) else: xmlparser.xmlParseChunk(pctxt, NULL, 0, 1) + + if (pctxt.recovery and not pctxt.disableSAX and + isinstance(context, _SaxParserContext)): + # apply any left-over 'end' events + (<_SaxParserContext>context).flushEvents() + try: result = context._handleParseResult(self, pctxt.myDoc, None) finally: |
