summaryrefslogtreecommitdiffstats
path: root/Lib/xml/sax/xmlreader.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml/sax/xmlreader.py')
-rw-r--r--Lib/xml/sax/xmlreader.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/xml/sax/xmlreader.py b/Lib/xml/sax/xmlreader.py
index 7ef497f..716f228 100644
--- a/Lib/xml/sax/xmlreader.py
+++ b/Lib/xml/sax/xmlreader.py
@@ -117,7 +117,9 @@ class IncrementalParser(XMLReader):
source = saxutils.prepare_input_source(source)
self.prepareParser(source)
- file = source.getByteStream()
+ file = source.getCharacterStream()
+ if file is None:
+ file = source.getByteStream()
buffer = file.read(self._bufsize)
while buffer:
self.feed(buffer)