Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 313b2ad

Browse files
committed
Fix imports in xml.dom.
1 parent 0a9dd2f commit 313b2ad

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Lib/test/test_minidom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def confirm(self, test, testname = "Test"):
4747

4848
def checkWholeText(self, node, s):
4949
t = node.wholeText
50-
self.confirm(t == s, "looking for %s, found %s" % (repr(s), repr(t)))
50+
self.confirm(t == s, "looking for %r, found %r" % (s, t))
5151

5252
def testParseFromFile(self):
5353
with open(tstfile) as file:

Lib/xml/dom/pulldom.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import xml.sax
22
import xml.sax.handler
3-
import types
43

54
START_ELEMENT = "START_ELEMENT"
65
END_ELEMENT = "END_ELEMENT"
@@ -334,10 +333,7 @@ def parse(stream_or_string, parser=None, bufsize=None):
334333
return DOMEventStream(stream, parser, bufsize)
335334

336335
def parseString(string, parser=None):
337-
try:
338-
from io import StringIO
339-
except ImportError:
340-
from io import StringIO
336+
from io import StringIO
341337

342338
bufsize = len(string)
343339
buf = StringIO(string)

0 commit comments

Comments
 (0)