summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 09043a8..70f1b8b 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -92,7 +92,8 @@ del dir, L
# Append ./build/lib.<platform> in case we're running in the build dir
# (especially for Guido :-)
-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)