Skip to content

Commit 3a04785

Browse files
committed
gh-151096: Fix test_embed with split exec prefix
1 parent 871047d commit 3a04785

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Lib/test/test_embed.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ def module_search_paths(self, prefix=None, exec_prefix=None):
14581458
if prefix is None:
14591459
prefix = config['config']['prefix']
14601460
if exec_prefix is None:
1461-
exec_prefix = config['config']['prefix']
1461+
exec_prefix = config['config']['exec_prefix']
14621462
if MS_WINDOWS:
14631463
return config['config']['module_search_paths']
14641464
else:
@@ -1614,8 +1614,10 @@ def test_init_is_python_build_with_home(self):
16141614
expected_paths[1 if MS_WINDOWS else 2] = os.path.normpath(
16151615
os.path.join(exedir, f'{f.read()}\n$'.splitlines()[0]))
16161616
if not MS_WINDOWS:
1617-
# PREFIX (default) is set when running in build directory
1618-
prefix = exec_prefix = sys.prefix
1617+
# PREFIX and EXEC_PREFIX (defaults) are set when running in the
1618+
# build directory and may differ with --exec-prefix (gh-151096).
1619+
prefix = sys.prefix
1620+
exec_prefix = sys.exec_prefix
16191621
# stdlib calculation (/Lib) is not yet supported
16201622
expected_paths[0] = self.module_search_paths(prefix=prefix)[0]
16211623
config.update(prefix=prefix, base_prefix=prefix,

0 commit comments

Comments
 (0)