diff options
author | Steve Dower <steve.dower@microsoft.com> | 2016-09-17 19:54:06 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2016-09-17 19:54:06 (GMT) |
commit | ed51b268580c1100b46bf5dbc4b4201146019644 (patch) | |
tree | ae52e3f469b71aa5e9634502eedf3c4e50c9f141 /Tools/msi/make_zip.py | |
parent | 313523ce2dd67db67b7dcbcc5f6d6ca95922b34b (diff) | |
download | cpython-ed51b268580c1100b46bf5dbc4b4201146019644.zip cpython-ed51b268580c1100b46bf5dbc4b4201146019644.tar.gz cpython-ed51b268580c1100b46bf5dbc4b4201146019644.tar.bz2 |
Issue #28137: Renames Windows path file to ._pth
Issue #28138: Windows ._pth file should allow import site
Diffstat (limited to 'Tools/msi/make_zip.py')
-rw-r--r-- | Tools/msi/make_zip.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py index e9d6dbc..ebb1766 100644 --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -91,11 +91,13 @@ def include_in_tools(p): return p.suffix.lower() in {'.py', '.pyw', '.txt'} +BASE_NAME = 'python{0.major}{0.minor}'.format(sys.version_info) + FULL_LAYOUT = [ ('/', 'PCBuild/$arch', 'python.exe', is_not_debug), ('/', 'PCBuild/$arch', 'pythonw.exe', is_not_debug), - ('/', 'PCBuild/$arch', 'python{0.major}.dll'.format(sys.version_info), is_not_debug), - ('/', 'PCBuild/$arch', 'python{0.major}{0.minor}.dll'.format(sys.version_info), is_not_debug), + ('/', 'PCBuild/$arch', 'python{}.dll'.format(sys.version_info.major), is_not_debug), + ('/', 'PCBuild/$arch', '{}.dll'.format(BASE_NAME), is_not_debug), ('DLLs/', 'PCBuild/$arch', '*.pyd', is_not_debug), ('DLLs/', 'PCBuild/$arch', '*.dll', is_not_debug_or_python), ('include/', 'include', '*.h', None), @@ -109,7 +111,7 @@ EMBED_LAYOUT = [ ('/', 'PCBuild/$arch', 'python*.exe', is_not_debug), ('/', 'PCBuild/$arch', '*.pyd', is_not_debug), ('/', 'PCBuild/$arch', '*.dll', is_not_debug), - ('python{0.major}{0.minor}.zip'.format(sys.version_info), 'Lib', '**/*', include_in_lib), + ('{}.zip'.format(BASE_NAME), 'Lib', '**/*', include_in_lib), ] if os.getenv('DOC_FILENAME'): @@ -209,9 +211,12 @@ def main(): print('Copied {} files'.format(copied)) if ns.embed: - with open(str(temp / 'sys.path'), 'w') as f: - print('python{0.major}{0.minor}.zip'.format(sys.version_info), file=f) + with open(str(temp / (BASE_NAME + '._pth')), 'w') as f: + print(BASE_NAME + '.zip', file=f) print('.', file=f) + print('', file=f) + print('# Uncomment to run site.main() automatically', file=f) + print('#import site', file=f) if out: total = copy_to_layout(out, rglob(temp, '**/*', None)) |