[Python-checkins] python/dist/src/Lib UserString.py,1.12,1.13

mwh@sourceforge.net mwh@sourceforge.net
Mon, 20 May 2002 07:48:18 -0700


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

Modified Files:
	UserString.py 
Log Message:
More --disable-unicode stuff.

I'm getting better at vi!


Index: UserString.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/UserString.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** UserString.py	15 Apr 2002 13:36:43 -0000	1.12
--- UserString.py	20 May 2002 14:48:16 -0000	1.13
***************
*** 6,10 ****
  This module requires Python 1.6 or later.
  """
! from types import StringType, UnicodeType
  import sys
  
--- 6,10 ----
  This module requires Python 1.6 or later.
  """
! from types import StringTypes
  import sys
  
***************
*** 13,17 ****
  class UserString:
      def __init__(self, seq):
!         if isinstance(seq, StringType) or isinstance(seq, UnicodeType):
              self.data = seq
          elif isinstance(seq, UserString):
--- 13,17 ----
  class UserString:
      def __init__(self, seq):
!         if isinstance(seq, StringTypes):
              self.data = seq
          elif isinstance(seq, UserString):
***************
*** 44,53 ****
          if isinstance(other, UserString):
              return self.__class__(self.data + other.data)
!         elif isinstance(other, StringType) or isinstance(other, UnicodeType):
              return self.__class__(self.data + other)
          else:
              return self.__class__(self.data + str(other))
      def __radd__(self, other):
!         if isinstance(other, StringType) or isinstance(other, UnicodeType):
              return self.__class__(other + self.data)
          else:
--- 44,53 ----
          if isinstance(other, UserString):
              return self.__class__(self.data + other.data)
!         elif isinstance(other, StringTypes):
              return self.__class__(self.data + other)
          else:
              return self.__class__(self.data + str(other))
      def __radd__(self, other):
!         if isinstance(other, StringTypes):
              return self.__class__(other + self.data)
          else:
***************
*** 56,60 ****
          if isinstance(other, UserString):
              self.data += other.data
!         elif isinstance(other, StringType) or isinstance(other, UnicodeType):
              self.data += other
          else:
--- 56,60 ----
          if isinstance(other, UserString):
              self.data += other.data
!         elif isinstance(other, StringTypes):
              self.data += other
          else:
***************
*** 160,164 ****
          if isinstance(sub, UserString):
              self.data = self.data[:start]+sub.data+self.data[end:]
!         elif isinstance(sub, StringType) or isinstance(sub, UnicodeType):
              self.data = self.data[:start]+sub+self.data[end:]
          else:
--- 160,164 ----
          if isinstance(sub, UserString):
              self.data = self.data[:start]+sub.data+self.data[end:]
!         elif isinstance(sub, StringTypes):
              self.data = self.data[:start]+sub+self.data[end:]
          else: