[Python-3000-checkins] r56586 - python/branches/py3k-struni/Lib/xml/dom/pulldom.py

guido.van.rossum python-3000-checkins at python.org
Fri Jul 27 19:26:01 CEST 2007


Author: guido.van.rossum
Date: Fri Jul 27 19:26:00 2007
New Revision: 56586

Modified:
   python/branches/py3k-struni/Lib/xml/dom/pulldom.py
Log:
SF patch# 1759922 by Alexandre Vassalotti.
Fix one of the two failing tests for minidom.


Modified: python/branches/py3k-struni/Lib/xml/dom/pulldom.py
==============================================================================
--- python/branches/py3k-struni/Lib/xml/dom/pulldom.py	(original)
+++ python/branches/py3k-struni/Lib/xml/dom/pulldom.py	Fri Jul 27 19:26:00 2007
@@ -2,11 +2,6 @@
 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 @@
 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


More information about the Python-3000-checkins mailing list