(self, source)
Parse an XML document from a URL or an InputSource.
Parse an XML document from a URL or an InputSource.
Parse an XML document from a URL or an InputSource .
def parse(self, source):
        "Parse an XML document from a URL or an InputSource."
        source = saxutils.prepare_input_source(source)

        self._source = source
        try:
            self.reset()
            self._cont_handler.setDocumentLocator(ExpatLocator(self))
            xmlreader.IncrementalParser.parse(self, source)
        except:
            # bpo-30264: Close the source on error to not leak resources:
            # xml.sax.parse() doesn't give access to the underlying parser
            # to the caller
            self._close_source()
            raise
def parse ( self , source ) : source = saxutils . prepare_input_source ( source ) self . _source = source try : self . reset ( ) self . _cont_handler . setDocumentLocator ( ExpatLocator ( self ) ) xmlreader . IncrementalParser . parse ( self , source ) except : # bpo-30264: Close the source on error to not leak resources: # xml.sax.parse() doesn't give access to the underlying parser # to the caller self . _close_source ( ) raise