]> granicus.if.org Git - python/commitdiff
SF patch# 1759922 by Alexandre Vassalotti.
authorGuido van Rossum <guido@python.org>
Fri, 27 Jul 2007 17:26:00 +0000 (17:26 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 27 Jul 2007 17:26:00 +0000 (17:26 +0000)
Fix one of the two failing tests for minidom.

Lib/xml/dom/pulldom.py

index fe9a3a2196e0f4d3f1fc21881952b5aa0b7e1ad7..c1463c91c0693f00f28b849cc31343365105cde4 100644 (file)
@@ -2,11 +2,6 @@ import xml.sax
 import xml.sax.handler
 import types
 
-try:
-    _StringTypes = [types.StringType, types.UnicodeType]
-except AttributeError:
-    _StringTypes = [types.StringType]
-
 START_ELEMENT = "START_ELEMENT"
 END_ELEMENT = "END_ELEMENT"
 COMMENT = "COMMENT"
@@ -330,7 +325,7 @@ default_bufsize = (2 ** 14) - 20
 def parse(stream_or_string, parser=None, bufsize=None):
     if bufsize is None:
         bufsize = default_bufsize
-    if type(stream_or_string) in _StringTypes:
+    if isinstance(stream_or_string, basestring):
         stream = open(stream_or_string)
     else:
         stream = stream_or_string