MCPcopy Index your code
hub / github.com/RustPython/RustPython / parse

Method parse

Lib/xml/sax/expatreader.py:97–111  ·  view source on GitHub ↗

Parse an XML document from a URL or an InputSource.

(self, source)

Source from the content-addressed store, hash-verified

95 # XMLReader methods
96
97 def parse(self, source):
98 "Parse an XML document from a URL or an InputSource."
99 source = saxutils.prepare_input_source(source)
100
101 self._source = source
102 try:
103 self.reset()
104 self._cont_handler.setDocumentLocator(ExpatLocator(self))
105 xmlreader.IncrementalParser.parse(self, source)
106 except:
107 # bpo-30264: Close the source on error to not leak resources:
108 # xml.sax.parse() doesn't give access to the underlying parser
109 # to the caller
110 self._close_source()
111 raise
112
113 def prepareParser(self, source):
114 if source.getSystemId() is not None:

Callers 2

external_entity_refMethod · 0.45
expatreader.pyFile · 0.45

Calls 4

resetMethod · 0.95
_close_sourceMethod · 0.95
ExpatLocatorClass · 0.85
setDocumentLocatorMethod · 0.45

Tested by

no test coverage detected