From c3213857163e401ec609d87db965bfa9c53c3e64 Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Sat, 5 Aug 2023 14:33:49 +0100 Subject: [PATCH 1/2] Use same logic to look for exec_prefix as for prefix and look for landmark for exec_prefix in library_dir --- Modules/getpath.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modules/getpath.py b/Modules/getpath.py index 9913fcba497d30..db762c6956a970 100644 --- a/Modules/getpath.py +++ b/Modules/getpath.py @@ -594,6 +594,12 @@ def search_up(prefix, *landmarks, test=isfile): prefix = abspath('') warn('Could not find platform independent libraries ') + # First try to detect exec_prefix by looking alongside our runtime library, if known + if library and not exec_prefix: + library_dir = dirname(library) + if PLATSTDLIB_LANDMARK: + if isdir(joinpath(library_dir, PLATSTDLIB_LANDMARK)): + exec_prefix = library_dir # Detect exec_prefix by searching from executable for the platstdlib_dir if PLATSTDLIB_LANDMARK and not exec_prefix: From b91433e364d0873bd9deef61b001a1268bc0a43f Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 5 Aug 2023 15:15:10 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2023-08-05-15-15-09.gh-issue-107658.wGMCYf.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-08-05-15-15-09.gh-issue-107658.wGMCYf.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-08-05-15-15-09.gh-issue-107658.wGMCYf.rst b/Misc/NEWS.d/next/Core and Builtins/2023-08-05-15-15-09.gh-issue-107658.wGMCYf.rst new file mode 100644 index 00000000000000..58328550bb55ce --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-08-05-15-15-09.gh-issue-107658.wGMCYf.rst @@ -0,0 +1 @@ +Use same logic to look for exec_prefix as for prefix