summaryrefslogtreecommitdiffstats
path: root/Lib/xml/sax/expatreader.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2000-09-24 20:38:18 (GMT)
committerLars Gustäbel <lars@gustaebel.de>2000-09-24 20:38:18 (GMT)
commitbb757136b29369e88c72e1563ee95cd6514c15a0 (patch)
tree8c1e6a6f736bf2f6e3c65ab9e89f4ac26b0af83a /Lib/xml/sax/expatreader.py
parent33315b180b3cc6981169cf60744445de91a6b8e9 (diff)
downloadcpython-bb757136b29369e88c72e1563ee95cd6514c15a0.zip
cpython-bb757136b29369e88c72e1563ee95cd6514c15a0.tar.gz
cpython-bb757136b29369e88c72e1563ee95cd6514c15a0.tar.bz2
Improvements to doco strings.
Tiny bug fix to expatreader.py (endDocument was only called after errors).
Diffstat (limited to 'Lib/xml/sax/expatreader.py')
-rw-r--r--Lib/xml/sax/expatreader.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py
index e3b3ad0..1d93542 100644
--- a/Lib/xml/sax/expatreader.py
+++ b/Lib/xml/sax/expatreader.py
@@ -1,6 +1,6 @@
"""
SAX driver for the Pyexpat C module. This driver works with
-pyexpat.__version__ == '1.5'.
+pyexpat.__version__ == '2.22'.
"""
version = "0.20"
@@ -28,7 +28,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
# XMLReader methods
def parse(self, source):
- "Parse an XML document from a URL."
+ "Parse an XML document from a URL or an InputSource."
source = saxutils.prepare_input_source(source)
self._source = source
@@ -40,7 +40,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
error_code = self._parser.ErrorCode
raise SAXParseException(expat.ErrorString(error_code), None, self)
- self._cont_handler.endDocument()
+ self._cont_handler.endDocument()
def prepareParser(self, source):
if source.getSystemId() != None:
@@ -108,7 +108,10 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
# self._parser.DefaultHandlerExpand =
# self._parser.NotStandaloneHandler =
self._parser.ExternalEntityRefHandler = self.external_entity_ref
-
+
+ self._parsing = 0
+ self._entity_stack = []
+
# Locator methods
def getColumnNumber(self):