mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-99370: Calculate zip path from prefix when in a venv (GH-99371)
Before python3.11, when in a venv the zip path is calculated
from prefix on POSIX platforms. In python3.11 the behavior is
accidentally changed to calculating from default prefix. This
change will break venv created from a non-installed python
with a stdlib zip file. This commit restores the behavior back
to before python3.11.
(cherry picked from commit e3d4fed074
)
Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
This commit is contained in:
parent
3b8bcfc789
commit
5971a65d07
4 changed files with 99 additions and 2 deletions
|
@ -679,9 +679,8 @@ elif not pythonpath_was_set:
|
|||
else:
|
||||
library_dir = executable_dir
|
||||
pythonpath.append(joinpath(library_dir, ZIP_LANDMARK))
|
||||
elif build_prefix or venv_prefix:
|
||||
elif build_prefix:
|
||||
# QUIRK: POSIX uses the default prefix when in the build directory
|
||||
# or a venv
|
||||
pythonpath.append(joinpath(PREFIX, ZIP_LANDMARK))
|
||||
else:
|
||||
pythonpath.append(joinpath(prefix, ZIP_LANDMARK))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue