Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Lib/test/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,13 @@ def test_system_site_packages(self):
))
""")

# Use _get_preferred_schemes to find the system scheme, in case we are in a virtual environment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why revert _get_preferred_schemes instead of just specifying prefix/exec_prefix?

# Use the base interpreter's scheme and prefixes, even when running
# inside a virtual environment.
system_scheme_name = sysconfig._get_preferred_schemes()['prefix']
system_paths = sysconfig.get_paths(system_scheme_name)
system_paths = sysconfig.get_paths(system_scheme_name, vars={
'base': sys.base_prefix,
'platbase': sys.base_exec_prefix,
})

with self.venv(system_site_packages=False) as venv:
sys_path = json.loads(venv.run('-c', script).stdout)
Expand Down
Loading