summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2002-12-30 22:08:05 (GMT)
committerJust van Rossum <just@letterror.com>2002-12-30 22:08:05 (GMT)
commit52e14d640be3a7fa2c17f5a2a6bc9626d622aa40 (patch)
tree417c361ba0bae8b22b262570769933ccdd5ad5e0 /Lib/site.py
parent60087fb45092d9c199cea162e58d9193c7c1558c (diff)
downloadcpython-52e14d640be3a7fa2c17f5a2a6bc9626d622aa40.zip
cpython-52e14d640be3a7fa2c17f5a2a6bc9626d622aa40.tar.gz
cpython-52e14d640be3a7fa2c17f5a2a6bc9626d622aa40.tar.bz2
PEP 302 + zipimport:
- new import hooks in import.c, exposed in the sys module - new module called 'zipimport' - various changes to allow bootstrapping from zip files I hope I didn't break the Windows build (or anything else for that matter), but then again, it's been sitting on sf long enough... Regarding the latest discussions on python-dev: zipimport sets pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as /path/to/Archive.zip/subdir/ are supported again.
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/Lib/site.py b/Lib/site.py
index a672765..0ab7a0f 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -73,16 +73,11 @@ del m
# only absolute pathnames, even if we're running from the build directory.
L = []
_dirs_in_sys_path = {}
+dir = dircase = None # sys.path may be empty at this point
for dir in sys.path:
- # Filter out paths that don't exist, but leave in the empty string
- # since it's a special case. We also need to special-case the Mac,
- # as file names are allowed on sys.path there.
- if sys.platform != 'mac':
- if dir and not os.path.isdir(dir):
- continue
- else:
- if dir and not os.path.exists(dir):
- continue
+ # Filter out duplicate paths (on case-insensitive file systems also
+ # if they only differ in case); turn relative paths into absolute
+ # paths.
dir, dircase = makepath(dir)
if not dircase in _dirs_in_sys_path:
L.append(dir)