Skip to content

Commit 07d2b13

Browse files
committed
pythonGH-66409: check if exec_prefix is the same as prefix before searching executable_dir
Signed-off-by: Filipe Laíns <[email protected]
1 parent 7b8bd3b commit 07d2b13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/getpath.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ def search_up(prefix, *landmarks, test=isfile):
621621
# gh-100320: Our PYDs are assumed to be relative to the Lib directory
622622
# (that is, prefix) rather than the executable (that is, executable_dir)
623623
exec_prefix = prefix
624+
if not exec_prefix and prefix and isdir(joinpath(prefix, PLATSTDLIB_LANDMARK)):
625+
exec_prefix = prefix
624626
if not exec_prefix and executable_dir:
625627
exec_prefix = search_up(executable_dir, PLATSTDLIB_LANDMARK, test=isdir)
626628
if not exec_prefix and EXEC_PREFIX:

0 commit comments

Comments
 (0)