]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix imports in xml.dom.
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 10 Dec 2011 20:14:53 +0000 (21:14 +0100)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 10 Dec 2011 20:14:53 +0000 (21:14 +0100)
Lib/test/test_minidom.py
Lib/xml/dom/pulldom.py

index 392e40e94fd80184f9979c600f5b19000496eca8..752a8409391b9a05a44e2237985c4464ebf5ac01 100644 (file)
@@ -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:
index d5ac8b2b9847b3b1e839942bfa864330f1a1d502..43504f76561652f3384b8b4ba62c12aea1fc4122 100644 (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)