[Python-checkins] python/dist/src/Lib platform.py,1.10,1.11

bcannon at users.sourceforge.net bcannon at users.sourceforge.net
Thu Mar 25 13:32:13 EST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31797/Lib

Modified Files:
	platform.py 
Log Message:
Fix last patch to be backwards-compatible with Python 1.5.2 .
Bumped version micro number.


Index: platform.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/platform.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** platform.py	25 Mar 2004 16:55:11 -0000	1.10
--- platform.py	25 Mar 2004 18:32:11 -0000	1.11
***************
*** 32,35 ****
--- 32,36 ----
  #
  #    History:
+ #    1.0.2 - fix a bug with caching of value for platform()
  #    1.0.1 - reformatted to make doc.py happy
  #    1.0.0 - reformatted a bit and checked into Python CVS
***************
*** 103,107 ****
  """
  
! __version__ = '1.0.1'
  
  import sys,string,os,re
--- 104,108 ----
  """
  
! __version__ = '1.0.2'
  
  import sys,string,os,re
***************
*** 1136,1141 ****
  ### The Opus Magnum of platform strings :-)
  
! _platform_cache = {True:None, False:None}
! _platform_aliased_cache = {True:None, False:None}
  
  def platform(aliased=0, terse=0):
--- 1137,1144 ----
  ### The Opus Magnum of platform strings :-)
  
! _platform_cache_terse = None
! _platform_cache_not_terse = None
! _platform_aliased_cache_terse = None
! _platform_aliased_cache_not_terse = None
  
  def platform(aliased=0, terse=0):
***************
*** 1158,1167 ****
  
      """
!     global _platform_cache,_platform_aliased_cache
  
!     if not aliased and (_platform_cache[bool(terse)] is not None):
!         return _platform_cache[bool(terse)]
!     elif _platform_aliased_cache[bool(terse)] is not None:
!         return _platform_aliased_cache[bool(terse)]
  
      # Get uname information and then apply platform specific cosmetics
--- 1161,1175 ----
  
      """
!     global _platform_cache_terse, _platform_cache_not_terse
!     global _platform_aliased_cache_terse, _platform_aliased_cache_not_terse
  
!     if not aliased and terse and (_platform_cache_terse is not None):
!         return _platform_cache_terse
!     elif not aliased and not terse and (_platform_cache_not_terse is not None):
!         return _platform_cache_not_terse
!     elif terse and _platform_aliased_cache_terse is not None:
!         return _platform_aliased_cache_terse
!     elif not terse and _platform_aliased_cache_not_terse is not None:
!         return _platform_aliased_cache_not_terse
  
      # Get uname information and then apply platform specific cosmetics
***************
*** 1219,1228 ****
              platform = _platform(system,release,machine,processor,bits,linkage)
  
!     if aliased:
!         _platform_aliased_cache[bool(terse)] = platform
      elif terse:
          pass
      else:
!         _platform_cache[bool(terse)] = platform
      return platform
  
--- 1227,1241 ----
              platform = _platform(system,release,machine,processor,bits,linkage)
  
!     if aliased and terse:
!         _platform_aliased_cache_terse = platform
!     elif aliased and not terse:
!         _platform_aliased_cache_not_terse = platform
      elif terse:
          pass
      else:
!         if terse:
!             _platform_cache_terse = platform
!         else:
!             _platform_cache_not_terse = platform
      return platform
  




More information about the Python-checkins mailing list