diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 19:27:37 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 19:27:37 (GMT) |
commit | 4bb142b1b712d8e67c81687d396685fba55abf77 (patch) | |
tree | 749fcb481ec718af5c9c048a0e2f170b4d71c353 /Lib/xml/sax | |
parent | 80ab6c53c6d90c0fae3828e5888d864d44b1c2ca (diff) | |
download | cpython-4bb142b1b712d8e67c81687d396685fba55abf77.zip cpython-4bb142b1b712d8e67c81687d396685fba55abf77.tar.gz cpython-4bb142b1b712d8e67c81687d396685fba55abf77.tar.bz2 |
Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/xml/sax')
-rw-r--r-- | Lib/xml/sax/_exceptions.py | 6 | ||||
-rw-r--r-- | Lib/xml/sax/xmlreader.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/xml/sax/_exceptions.py b/Lib/xml/sax/_exceptions.py index fdd614a..a9b2ba3 100644 --- a/Lib/xml/sax/_exceptions.py +++ b/Lib/xml/sax/_exceptions.py @@ -12,7 +12,7 @@ class SAXException(Exception): the application: you can subclass it to provide additional functionality, or to add localization. Note that although you will receive a SAXException as the argument to the handlers in the - ErrorHandler interface, you are not actually required to throw + ErrorHandler interface, you are not actually required to raise the exception; instead, you can simply read the information in it.""" @@ -50,7 +50,7 @@ class SAXParseException(SAXException): the original XML document. Note that although the application will receive a SAXParseException as the argument to the handlers in the ErrorHandler interface, the application is not actually required - to throw the exception; instead, it can simply read the + to raise the exception; instead, it can simply read the information in it and take a different action. Since this exception is a subclass of SAXException, it inherits @@ -62,7 +62,7 @@ class SAXParseException(SAXException): self._locator = locator # We need to cache this stuff at construction time. - # If this exception is thrown, the objects through which we must + # If this exception is raised, the objects through which we must # traverse to get this information may be deleted by the time # it gets caught. self._systemId = self._locator.getSystemId() diff --git a/Lib/xml/sax/xmlreader.py b/Lib/xml/sax/xmlreader.py index 46ee02b..74aa39a 100644 --- a/Lib/xml/sax/xmlreader.py +++ b/Lib/xml/sax/xmlreader.py @@ -68,7 +68,7 @@ class XMLReader: SAX parsers are not required to provide localization for errors and warnings; if they cannot support the requested locale, - however, they must throw a SAX exception. Applications may + however, they must raise a SAX exception. Applications may request a locale change in the middle of a parse.""" raise SAXNotSupportedException("Locale support not implemented") |