equal
deleted
inserted
replaced
165 def _parse(self, data): |
165 def _parse(self, data): |
166 inpsrc = sax.InputSource() |
166 inpsrc = sax.InputSource() |
167 inpsrc.setByteStream(StringIO(data)) |
167 inpsrc.setByteStream(StringIO(data)) |
168 try: |
168 try: |
169 self._parser.parse(inpsrc) |
169 self._parser.parse(inpsrc) |
170 except sax.SAXParseException, exc: |
170 except sax.SAXParseException as exc: |
171 new_exc = AssertionError(u'invalid document: %s' % exc) |
171 new_exc = AssertionError(u'invalid document: %s' % exc) |
172 new_exc.position = (exc._linenum, exc._colnum) |
172 new_exc.position = (exc._linenum, exc._colnum) |
173 raise new_exc |
173 raise new_exc |
174 return super(XMLSyntaxValidator, self)._parse(data) |
174 return super(XMLSyntaxValidator, self)._parse(data) |
175 |
175 |