mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-46015: Fixes calculation of sys.path in a venv on Windows (GH-29992)
Also ensures that pybuilddir.txt is written early enough in the build to be picked up by later steps.
This commit is contained in:
parent
3cb9731b7e
commit
7778116c2f
6 changed files with 20 additions and 12 deletions
|
@ -668,14 +668,17 @@ elif not pythonpath:
|
|||
pythonpath.append(joinpath(prefix, p))
|
||||
|
||||
# Then add stdlib_dir and platstdlib_dir
|
||||
if stdlib_dir:
|
||||
pythonpath.append(stdlib_dir)
|
||||
if platstdlib_dir:
|
||||
if os_name == 'nt' and venv_prefix:
|
||||
# QUIRK: Windows appends executable_dir instead of platstdlib_dir
|
||||
# when in a venv
|
||||
pythonpath.append(executable_dir)
|
||||
else:
|
||||
if os_name == 'nt' and venv_prefix:
|
||||
# QUIRK: Windows generates paths differently in a venv
|
||||
if platstdlib_dir:
|
||||
pythonpath.append(platstdlib_dir)
|
||||
if stdlib_dir:
|
||||
pythonpath.append(stdlib_dir)
|
||||
pythonpath.append(executable_dir)
|
||||
else:
|
||||
if stdlib_dir:
|
||||
pythonpath.append(stdlib_dir)
|
||||
if platstdlib_dir:
|
||||
pythonpath.append(platstdlib_dir)
|
||||
|
||||
config['module_search_paths'] = pythonpath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue