diff --git a/Lib/xmllib.py b/Lib/xmllib.py index b8422cb4508..2f925563de1 100644 --- a/Lib/xmllib.py +++ b/Lib/xmllib.py @@ -8,6 +8,9 @@ version = '0.3' +class Error(RuntimeError): + pass + # Regular expressions used for parsing _S = '[ \t\r\n]+' # white space @@ -309,7 +312,7 @@ def goahead(self, end): 'encoding', 'standalone') if version[1:-1] != '1.0': - raise RuntimeError, 'only XML version 1.0 supported' + raise Error('only XML version 1.0 supported') if encoding: encoding = encoding[1:-1] if standalone: standalone = standalone[1:-1] self.handle_xml(encoding, standalone) @@ -390,7 +393,7 @@ def goahead(self, end): i = i+1 continue else: - raise RuntimeError, 'neither < nor & ??' + raise Error('neither < nor & ??') # We get here only if incomplete matches but # nothing else break @@ -419,7 +422,7 @@ def goahead(self, end): def parse_comment(self, i): rawdata = self.rawdata if rawdata[i:i+4] <> '