summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-03-23 17:53:49 (GMT)
committerBarry Warsaw <barry@python.org>2001-03-23 17:53:49 (GMT)
commit62d248892f8782d01cfeb1951d53eaeac81750fe (patch)
tree85be76bd682f2ec19fb18dab104a38c81bcd49e6 /Lib
parent27dca06f0cd825635765e974a3a657d7192af6b0 (diff)
downloadcpython-62d248892f8782d01cfeb1951d53eaeac81750fe.zip
cpython-62d248892f8782d01cfeb1951d53eaeac81750fe.tar.gz
cpython-62d248892f8782d01cfeb1951d53eaeac81750fe.tar.bz2
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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/site.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 807ebc7..73b3281 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -14,7 +14,7 @@ This will append site-specific paths to to the module search path. On
Unix, it starts with sys.prefix and sys.exec_prefix (if different) and
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
+\(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.
@@ -71,7 +71,7 @@ def makepath(*paths):
L = sys.modules.values()
for m in L:
- if hasattr(m, "__file__"):
+ if hasattr(m, "__file__") and m.__file__:
m.__file__ = makepath(m.__file__)
del m, L
@@ -233,7 +233,7 @@ here = os.path.dirname(os.__file__)
__builtin__.license = _Printer(
"license", "See http://www.pythonlabs.com/products/python2.0/license.html",
["LICENSE.txt", "LICENSE"],
- [here, os.path.join(here, os.pardir), os.curdir])
+ [os.path.join(here, os.pardir), here, os.curdir])
# Set the string encoding used by the Unicode implementation. The