summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2002-09-19 11:11:27 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2002-09-19 11:11:27 (GMT)
commit7ccd30fa438ff5518752b34cadb41dd1c12d6032 (patch)
tree79b21d85fa6e35e81b73c79e49bb2986e94ceabe /Lib
parent01824bf50c2967c264b0fb4a13d08bb5c1d9665c (diff)
downloadcpython-7ccd30fa438ff5518752b34cadb41dd1c12d6032.zip
cpython-7ccd30fa438ff5518752b34cadb41dd1c12d6032.tar.gz
cpython-7ccd30fa438ff5518752b34cadb41dd1c12d6032.tar.bz2
Fix a problem in site.py which triggers in case sys.path is empty.
Bugfix candidate for 2.2.2.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/site.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/site.py b/Lib/site.py
index a6ffb59..0d1ea39 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -94,7 +94,8 @@ del dir, dircase, L
# (especially for Guido :-)
# XXX This should not be part of site.py, since it is needed even when
# using the -S option for Python. See http://www.python.org/sf/586680
-if os.name == "posix" and os.path.basename(sys.path[-1]) == "Modules":
+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)