mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
_exceptions: Format a missing system id as <unknown>.
expatreader: Use the error handler instead of raising exception directly.
This commit is contained in:
parent
3383792c74
commit
04f4943d13
2 changed files with 7 additions and 5 deletions
|
|
@ -81,7 +81,8 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
|
|||
self._parser.Parse(data, isFinal)
|
||||
except expat.error:
|
||||
error_code = self._parser.ErrorCode
|
||||
raise SAXParseException(expat.ErrorString(error_code), None, self)
|
||||
exc = SAXParseException(expat.ErrorString(error_code), None, self)
|
||||
self._err_handler.fatalError(exc)
|
||||
|
||||
def close(self):
|
||||
if self._entity_stack:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue