[Python-checkins] CVS: python/dist/src/Lib site.py,1.25,1.26

Barry Warsaw bwarsaw@users.sourceforge.net
Fri, 23 Mar 2001 09:53:51 -0800


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

Modified Files:
	site.py 
Log Message:
Two minor changes for better Jython compatibility.  Finn Bock says:

    Change 1: Not all 'modules' in sys.modules have a 
    sensible __file__ attribute. Some of our java package 
    can have the __file__ attribute set to None. 

    Change 2: In jython we have the jython license file in 
    <root> and the CPython license file in <root>/Lib. By 
    reversing the search sequence jython will find and 
    show the jython license file before the CPython file.

Closes SF patch #405853.


Index: site.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** site.py	2001/03/02 06:43:49	1.25
--- site.py	2001/03/23 17:53:49	1.26
***************
*** 15,19 ****
  appends lib/python<version>/site-packages as well as lib/site-python.
  On other platforms (mainly Mac and Windows), it uses just sys.prefix
! (and sys.exec_prefix, if different, but this is unlikely).  The
  resulting directories, if they exist, are appended to sys.path, and
  also inspected for path configuration files.
--- 15,19 ----
  appends lib/python<version>/site-packages as well as lib/site-python.
  On other platforms (mainly Mac and Windows), it uses just sys.prefix
! \(and sys.exec_prefix, if different, but this is unlikely).  The
  resulting directories, if they exist, are appended to sys.path, and
  also inspected for path configuration files.
***************
*** 72,76 ****
  L = sys.modules.values()
  for m in L:
!     if hasattr(m, "__file__"):
          m.__file__ = makepath(m.__file__)
  del m, L
--- 72,76 ----
  L = sys.modules.values()
  for m in L:
!     if hasattr(m, "__file__") and m.__file__:
          m.__file__ = makepath(m.__file__)
  del m, L
***************
*** 234,238 ****
      "license", "See http://www.pythonlabs.com/products/python2.0/license.html",
      ["LICENSE.txt", "LICENSE"],
!     [here, os.path.join(here, os.pardir), os.curdir])
  
  
--- 234,238 ----
      "license", "See http://www.pythonlabs.com/products/python2.0/license.html",
      ["LICENSE.txt", "LICENSE"],
!     [os.path.join(here, os.pardir), here, os.curdir])