Fix imports in xml.dom.

This commit is contained in:
Florent Xicluna 2011-12-10 21:14:53 +01:00
parent 0a9dd2f11d
commit 313b2ad1a8
2 changed files with 2 additions and 6 deletions

View File

@ -47,7 +47,7 @@ def confirm(self, test, testname = "Test"):
def checkWholeText(self, node, s):
t = node.wholeText
self.confirm(t == s, "looking for %s, found %s" % (repr(s), repr(t)))
self.confirm(t == s, "looking for %r, found %r" % (s, t))
def testParseFromFile(self):
with open(tstfile) as file:

View File

@ -1,6 +1,5 @@
import xml.sax
import xml.sax.handler
import types
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
@ -334,10 +333,7 @@ def parse(stream_or_string, parser=None, bufsize=None):
return DOMEventStream(stream, parser, bufsize)
def parseString(string, parser=None):
try:
from io import StringIO
except ImportError:
from io import StringIO
from io import StringIO
bufsize = len(string)
buf = StringIO(string)