[Python-checkins] CVS: python/dist/src/Lib ConfigParser.py,1.35,1.36 copy.py,1.19,1.20 site.py,1.34,1.35 types.py,1.19,1.20

Martin v. L?wis loewis@users.sourceforge.net
Fri, 17 Aug 2001 11:39:26 -0700


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

Modified Files:
	ConfigParser.py copy.py site.py types.py 
Log Message:
Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.


Index: ConfigParser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** ConfigParser.py	2001/08/13 14:58:32	1.35
--- ConfigParser.py	2001/08/17 18:39:24	1.36
***************
*** 83,87 ****
  """
  
! import string
  import re
  
--- 83,87 ----
  """
  
! import string, types
  import re
  
***************
*** 223,227 ****
          filename may also be given.
          """
!         if type(filenames) in [type(''), type(u'')]:
              filenames = [filenames]
          for filename in filenames:
--- 223,227 ----
          filename may also be given.
          """
!         if type(filenames) in types.StringTypes:
              filenames = [filenames]
          for filename in filenames:

Index: copy.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/copy.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** copy.py	2001/01/20 19:54:20	1.19
--- copy.py	2001/08/17 18:39:24	1.20
***************
*** 92,96 ****
  d[types.FloatType] = _copy_atomic
  d[types.StringType] = _copy_atomic
! d[types.UnicodeType] = _copy_atomic
  try:
      d[types.CodeType] = _copy_atomic
--- 92,99 ----
  d[types.FloatType] = _copy_atomic
  d[types.StringType] = _copy_atomic
! try:
!     d[types.UnicodeType] = _copy_atomic
! except AttributeError:
!     pass
  try:
      d[types.CodeType] = _copy_atomic
***************
*** 171,175 ****
  d[types.FloatType] = _deepcopy_atomic
  d[types.StringType] = _deepcopy_atomic
! d[types.UnicodeType] = _deepcopy_atomic
  d[types.CodeType] = _deepcopy_atomic
  d[types.TypeType] = _deepcopy_atomic
--- 174,181 ----
  d[types.FloatType] = _deepcopy_atomic
  d[types.StringType] = _deepcopy_atomic
! try:
!     d[types.UnicodeType] = _deepcopy_atomic
! except AttributeError:
!     pass
  d[types.CodeType] = _deepcopy_atomic
  d[types.TypeType] = _deepcopy_atomic

Index: site.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** site.py	2001/08/15 21:20:42	1.34
--- site.py	2001/08/17 18:39:24	1.35
***************
*** 306,310 ****
  
  if encoding != "ascii":
!     sys.setdefaultencoding(encoding)
  
  #
--- 306,311 ----
  
  if encoding != "ascii":
!     # On Non-Unicode builds this will raise an AttributeError...
!     sys.setdefaultencoding(encoding) # Needs Python Unicode build !
  
  #

Index: types.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/types.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** types.py	2001/08/11 15:02:57	1.19
--- types.py	2001/08/17 18:39:24	1.20
***************
*** 20,24 ****
  
  StringType = str
! UnicodeType = unicode
  BufferType = type(buffer(''))
  
--- 20,29 ----
  
  StringType = str
! try:
!     UnicodeType = unicode
!     StringTypes = [StringType, UnicodeType]
! except NameError:
!     StringTypes = [StringType]
! 
  BufferType = type(buffer(''))