summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2011-12-10 20:14:53 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2011-12-10 20:14:53 (GMT)
commit313b2ad1a8fa518467a2ea9b0ac4cc6d483a191a (patch)
tree3da24bcb630c2c07d1977da000f64529c3d9603d /Lib
parent0a9dd2f11db2a52fbc2cabaf0755aa33ad9372e5 (diff)
downloadcpython-313b2ad1a8fa518467a2ea9b0ac4cc6d483a191a.zip
cpython-313b2ad1a8fa518467a2ea9b0ac4cc6d483a191a.tar.gz
cpython-313b2ad1a8fa518467a2ea9b0ac4cc6d483a191a.tar.bz2
Fix imports in xml.dom.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_minidom.py2
-rw-r--r--Lib/xml/dom/pulldom.py6
2 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 392e40e..752a840 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -47,7 +47,7 @@ class MinidomTest(unittest.TestCase):
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:
diff --git a/Lib/xml/dom/pulldom.py b/Lib/xml/dom/pulldom.py
index d5ac8b2..43504f7 100644
--- a/Lib/xml/dom/pulldom.py
+++ b/Lib/xml/dom/pulldom.py
@@ -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)