Skip to content

Commit 41f66b4

Browse files
committed
split patches for python version
1 parent 94f5546 commit 41f66b4

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
@@ -633,7 +633,12 @@ fi
633633
# executable_dir when valid. This allows venv to be created from symlinks
634634
# See:
635635
# https://github.com/python/cpython/issues/106045#issuecomment-2594628161
636-
patch -p1 -i "${ROOT}/patch-getpath-use-base_executable-for-executable_dir.patch"
636+
# 3.10 does not use getpath.py only getpath.c, no patch is applied
637+
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" ]; then
638+
patch -p1 -i "${ROOT}/patch-getpath-use-base_executable-for-executable_dir-314.patch"
639+
elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then
640+
patch -p1 -i "${ROOT}/patch-getpath-use-base_executable-for-executable_dir.patch"
641+
fi
637642

638643
# We patched configure.ac above. Reflect those changes.
639644
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)