This commit is contained in:
ton
2024-10-07 10:13:40 +07:00
parent aa1631742f
commit 3a7d696db6
9729 changed files with 1832837 additions and 161742 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+14
View File
@@ -214,6 +214,20 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
# FIXME: when to invoke error()?
self._err_handler.fatalError(exc)
def flush(self):
if self._parser is None:
return
was_enabled = self._parser.GetReparseDeferralEnabled()
try:
self._parser.SetReparseDeferralEnabled(False)
self._parser.Parse(b"", False)
except expat.error as e:
exc = SAXParseException(expat.ErrorString(e.code), e, self)
self._err_handler.fatalError(exc)
finally:
self._parser.SetReparseDeferralEnabled(was_enabled)
def _close_source(self):
source = self._source
try: