[Python-checkins] CVS: python/dist/src/Lib/xml/dom pulldom.py,1.13,1.14

Martin v. Löwis python-dev@python.org
Thu, 28 Dec 2000 10:43:04 -0800


Update of /cvsroot/python/python/dist/src/Lib/xml/dom
In directory usw-pr-cvs1:/tmp/cvs-serv22869

Modified Files:
	pulldom.py 
Log Message:
Merge with 1.8 of pulldom.py:
Use types.UnicodeType if available, not type(u"").


Index: pulldom.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xml/dom/pulldom.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** pulldom.py	2000/12/20 14:47:24	1.13
--- pulldom.py	2000/12/28 18:43:02	1.14
***************
*** 1,5 ****
--- 1,11 ----
  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"
***************
*** 236,240 ****
      if bufsize is None:
          bufsize = default_bufsize
!     if type(stream_or_string) in [type(""), type(u"")]:
          stream = open(stream_or_string)
      else:
--- 242,246 ----
      if bufsize is None:
          bufsize = default_bufsize
!     if type(stream_or_string) in _StringTypes:
          stream = open(stream_or_string)
      else: