Commit 7ccd30fa authored by Marc-André Lemburg's avatar Marc-André Lemburg

Fix a problem in site.py which triggers in case sys.path is empty.

Bugfix candidate for 2.2.2.
parent 01824bf5
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment