summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2003-07-18 17:24:07 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2003-07-18 17:24:07 (GMT)
commitbdf3b509ed9f131d3c868d6097f8e02c8a9d554e (patch)
treef31e21d67efccd30a830ca2b33af9c2278573306 /Lib
parenta920a8895e3f8919165b7bfd656a07864053f964 (diff)
downloadcpython-bdf3b509ed9f131d3c868d6097f8e02c8a9d554e.zip
cpython-bdf3b509ed9f131d3c868d6097f8e02c8a9d554e.tar.gz
cpython-bdf3b509ed9f131d3c868d6097f8e02c8a9d554e.tar.bz2
SF patch 773476: NameError when there are no prefixes.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/site.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/site.py b/Lib/site.py
index cc6dd39..3e93a07 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -91,11 +91,16 @@ del dir, dircase, L
# using the -S option for Python. See http://www.python.org/sf/586680
if (os.name == "posix" and sys.path and
os.path.basename(sys.path[-1]) == "Modules"):
- from distutils.util import get_platform
- s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
+ s = "build/lib.%s-%.3s" % ("linux-i686", sys.version)
s = os.path.join(os.path.dirname(sys.path[-1]), s)
sys.path.append(s)
- del get_platform, s
+##if (os.name == "posix" and sys.path and
+## os.path.basename(sys.path[-1]) == "Modules"):
+## from distutils.util import get_platform
+## s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
+## s = os.path.join(os.path.dirname(sys.path[-1]), s)
+## sys.path.append(s)
+## del get_platform, s
def _init_pathinfo():
global _dirs_in_sys_path
@@ -158,6 +163,7 @@ def addpackage(sitedir, name):
_dirs_in_sys_path = None
prefixes = [sys.prefix]
+sitedir = None # make sure sitedir is initialized because of later 'del'
if sys.exec_prefix != sys.prefix:
prefixes.append(sys.exec_prefix)
for prefix in prefixes: