diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-11-14 15:31:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-14 15:31:46 (GMT) |
commit | 5971a65d077739e5f3412a662511a240976ccd99 (patch) | |
tree | fc80758118abdff295d948bec60d97fd354d1741 /Modules/getpath.py | |
parent | 3b8bcfc78985b952cf7e17c97713963cc9b875e8 (diff) | |
download | cpython-5971a65d077739e5f3412a662511a240976ccd99.zip cpython-5971a65d077739e5f3412a662511a240976ccd99.tar.gz cpython-5971a65d077739e5f3412a662511a240976ccd99.tar.bz2 |
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 e3d4fed07429670af631e5662086b76c1ec098c4)
Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
Diffstat (limited to 'Modules/getpath.py')
-rw-r--r-- | Modules/getpath.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/getpath.py b/Modules/getpath.py index b8ad53e..fc533a8 100644 --- a/Modules/getpath.py +++ b/Modules/getpath.py @@ -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)) |