diff options
author | Raymond Hettinger <python@rcn.com> | 2002-10-06 03:52:44 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-10-06 03:52:44 (GMT) |
commit | c2f12167cb1565122cff8f33cf95fc5447c9a1f9 (patch) | |
tree | d970353ba51aad17acfc418c46f0235000279e3c | |
parent | e1c9e10cd7dc8ed1e09c5c0b09154c3b2eec22c3 (diff) | |
download | cpython-c2f12167cb1565122cff8f33cf95fc5447c9a1f9.zip cpython-c2f12167cb1565122cff8f33cf95fc5447c9a1f9.tar.gz cpython-c2f12167cb1565122cff8f33cf95fc5447c9a1f9.tar.bz2 |
Backport 1.45:
Fix a problem in site.py which triggers in case sys.path is empty.
Bugfix candidate for 2.2.2.
-rw-r--r-- | Lib/site.py | 3 |
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) |