xref: /trunk/main/python/python-solver-before-std.patch (revision e278cb3926a29fb9a38f15711fbfdef43c02602f)
1diff -ur misc/Python-3.11.15/setup.py misc/build/Python-3.11.15/setup.py
2--- misc/Python-3.11.15/setup.py    2025-01-01 00:00:00.000000000 +0000
3+++ misc/build/Python-3.11.15/setup.py  2025-01-01 00:00:00.000000000 +0000
4@@ -248,24 +248,24 @@
5         # system, but with only header files and libraries.
6         sysroot = macosx_sdk_root()
7
8-    # Check the standard locations
9-    for dir_ in std_dirs:
10+    # Check the additional directories (solver paths take priority)
11+    for dir_ in paths:
12         f = os.path.join(dir_, filename)
13
14         if MACOS and is_macosx_sdk_path(dir_):
15             f = os.path.join(sysroot, dir_[1:], filename)
16
17-        if os.path.exists(f): return []
18+        if os.path.exists(f):
19+            return [dir_]
20
21-    # Check the additional directories
22-    for dir_ in paths:
23+    # Check the standard locations
24+    for dir_ in std_dirs:
25         f = os.path.join(dir_, filename)
26
27         if MACOS and is_macosx_sdk_path(dir_):
28             f = os.path.join(sysroot, dir_[1:], filename)
29
30-        if os.path.exists(f):
31-            return [dir_]
32+        if os.path.exists(f): return []
33
34     # Not found anywhere
35     return None
36