mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
60087fb450
commit
52e14d640b
13 changed files with 1887 additions and 35 deletions
13
Lib/site.py
13
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue