Skip to content

Commit b114efc

Browse files
jjhelmusgeofft
authored andcommitted
split patches for python version
1 parent 3e4d886 commit b114efc

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

cpython-unix/build-cpython.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,12 @@ fi
640640
# determine executable_dir when valid. This allows venv to be created from symlinks and covers some
641641
# cases the above patch doesn't. See:
642642
# https://github.com/python/cpython/issues/106045#issuecomment-2594628161
643-
patch -p1 -i "${ROOT}/patch-getpath-use-base_executable-for-executable_dir.patch"
643+
# 3.10 does not use getpath.py only getpath.c, no patch is applied
644+
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" ]; then
645+
patch -p1 -i "${ROOT}/patch-getpath-use-base_executable-for-executable_dir-314.patch"
646+
elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then
647+
patch -p1 -i "${ROOT}/patch-getpath-use-base_executable-for-executable_dir.patch"
648+
fi
644649

645650
# We patched configure.ac above. Reflect those changes.
646651
autoconf
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/Modules/getpath.py b/Modules/getpath.py
2+
index ceb605a75c8..164d708ffca 100644
3+
--- a/Modules/getpath.py
4+
+++ b/Modules/getpath.py
5+
@@ -411,6 +411,9 @@ def search_up(prefix, *landmarks, test=isfile):
6+
if isfile(candidate):
7+
base_executable = candidate
8+
break
9+
+ if base_executable and isfile(base_executable):
10+
+ # Update the executable directory to be based on the resolved base executable
11+
+ executable_dir = real_executable_dir = dirname(base_executable)
12+
# home key found; stop iterating over lines
13+
break
14+
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
diff --git a/Modules/getpath.py b/Modules/getpath.py
2-
index ceb605a75c8..164d708ffca 100644
2+
index 1f1bfcb4f64..ff5b18cc385 100644
33
--- a/Modules/getpath.py
44
+++ b/Modules/getpath.py
5-
@@ -411,6 +411,9 @@ def search_up(prefix, *landmarks, test=isfile):
5+
@@ -398,6 +398,9 @@ def search_up(prefix, *landmarks, test=isfile):
66
if isfile(candidate):
77
base_executable = candidate
88
break
99
+ if base_executable and isfile(base_executable):
1010
+ # Update the executable directory to be based on the resolved base executable
1111
+ executable_dir = real_executable_dir = dirname(base_executable)
12-
# home key found; stop iterating over lines
1312
break
14-
13+
else:
14+
venv_prefix = None
15+

0 commit comments

Comments
 (0)