Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-91985: Ensure in-tree builds override platstdlib_dir in every path calculation #93641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jun 16, 2022
Merged
Prev Previous commit
Next Next commit
comment, etc.
  • Loading branch information
neonene committed Jun 15, 2022
commit 8b1591780bc6c10072381a14aaf4d26daedeb949
24 changes: 10 additions & 14 deletions 24 Lib/test/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ def test_init_setpythonhome(self):
api=API_COMPAT, env=env)

def test_init_is_python_build_with_home(self):
# Test _Py_path_config._is_python_build field (gh-91985)
# Test _Py_path_config._is_python_build configuration (gh-91985)
config = self._get_expected_config()
paths = config['config']['module_search_paths']
paths_str = os.path.pathsep.join(paths)
Expand Down Expand Up @@ -1348,24 +1348,20 @@ def test_init_is_python_build_with_home(self):

env['NEGATIVE_ISPYTHONBUILD'] = '0'
config['_is_python_build'] = 1

exedir = os.path.dirname(sys.executable)
with open(os.path.join(exedir, 'pybuilddir.txt'), encoding='utf8') as f:
platstdlib = os.path.join(exedir, f'{f.read()}\n$'.splitlines()[0])
platstdlib = os.path.normpath(platstdlib)

platstdlib = os.path.normpath(os.path.join(exedir,
f'{f.read()}\n$'.splitlines()[0]))
if MS_WINDOWS:
expected_paths = [paths[0], stdlib, platstdlib]
expected_paths[2] = platstdlib
else:
# PREFIX (default) is set when running in build directory
prefix = exec_prefix = sys.prefix
# stdlib calculation (/Lib) is not yet supported.
stdlib = os.path.join(home, sys.platlibdir, f'python{version}')
expected_paths = [self.module_search_paths(prefix=prefix)[0],
stdlib, platstdlib]

config.update(module_search_paths=expected_paths,
prefix=prefix, base_prefix=prefix,
exec_prefix=exec_prefix, base_exec_prefix=exec_prefix)
# stdlib calculation (/Lib) is not yet supported
expected_paths[0] = self.module_search_paths(prefix=prefix)[0]
expected_paths[2] = platstdlib
config.update(prefix=prefix, base_prefix=prefix,
exec_prefix=exec_prefix, base_exec_prefix=exec_prefix)
self.check_all_configs("test_init_is_python_build", config,
api=API_COMPAT, env=env)

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.