From c2f12167cb1565122cff8f33cf95fc5447c9a1f9 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 6 Oct 2002 03:52:44 +0000 Subject: Backport 1.45: Fix a problem in site.py which triggers in case sys.path is empty. Bugfix candidate for 2.2.2. --- Lib/site.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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. 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) -- cgit v0.12