@@ -87,25 +87,25 @@ pub fn get_known_symlinks_impl(
87
87
let version = version. as_str ( ) . to_string ( ) ;
88
88
let mut symlinks = vec ! [ symlink_resolved_python_exe. to_owned( ) ] ;
89
89
for possible_symlink in [
90
- PathBuf :: from ( format ! ( "/opt/homebrew/bin/python{}" , version ) ) ,
91
- PathBuf :: from ( format ! ( "/opt/homebrew/opt/python@{}/bin/python{}" , version , version ) ) ,
92
- PathBuf :: from ( format ! ( "/opt/homebrew/Cellar/python@{}/{}/bin/python{}" , version , full_version , version ) ) ,
93
- PathBuf :: from ( format ! ( "/opt/homebrew/Cellar/python@{}/{}/Frameworks/Python.framework/Versions/{}/bin/python{}" , version , full_version , version , version ) ) ,
94
- PathBuf :: from ( format ! ( "/opt/homebrew/Cellar/python@{}/{}/Frameworks/Python.framework/Versions/Current/bin/python{}" , version , full_version , version ) ) ,
95
- PathBuf :: from ( format ! ( "/opt/homebrew/Frameworks/Python.framework/Versions/{}/bin/python{}" , version , version ) ) ,
96
- PathBuf :: from ( format ! ( "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python{}" , version ) ) ,
97
- PathBuf :: from ( format ! ( "/usr/local/opt/python@{}/bin/python3" , version ) ) ,
98
- PathBuf :: from ( format ! ( "/usr/local/opt/python@{}/bin/python{}" , version , version ) ) ,
90
+ PathBuf :: from ( format ! ( "/opt/homebrew/bin/python{version}" ) ) ,
91
+ PathBuf :: from ( format ! ( "/opt/homebrew/opt/python@{version }/bin/python{version}" ) ) ,
92
+ PathBuf :: from ( format ! ( "/opt/homebrew/Cellar/python@{version }/{full_version }/bin/python{version}" ) ) ,
93
+ PathBuf :: from ( format ! ( "/opt/homebrew/Cellar/python@{version }/{full_version }/Frameworks/Python.framework/Versions/{version }/bin/python{version}" ) ) ,
94
+ PathBuf :: from ( format ! ( "/opt/homebrew/Cellar/python@{version }/{full_version }/Frameworks/Python.framework/Versions/Current/bin/python{version}" ) ) ,
95
+ PathBuf :: from ( format ! ( "/opt/homebrew/Frameworks/Python.framework/Versions/{version }/bin/python{version}" ) ) ,
96
+ PathBuf :: from ( format ! ( "/opt/homebrew/Frameworks/Python.framework/Versions/Current/bin/python{version}" ) ) ,
97
+ PathBuf :: from ( format ! ( "/usr/local/opt/python@{version }/bin/python3" ) ) ,
98
+ PathBuf :: from ( format ! ( "/usr/local/opt/python@{version }/bin/python{version}" ) ) ,
99
99
PathBuf :: from ( "/opt/homebrew/opt/python/bin/python3" ) ,
100
- PathBuf :: from ( format ! ( "/opt/homebrew/opt/python/bin/python{}" , version ) ) ,
100
+ PathBuf :: from ( format ! ( "/opt/homebrew/opt/python/bin/python{version}" ) ) ,
101
101
PathBuf :: from ( "/opt/homebrew/opt/python@3/bin/python3" ) ,
102
- PathBuf :: from ( format ! ( "/opt/homebrew/opt/python@3/bin/python{}" , version ) ) ,
103
- PathBuf :: from ( format ! ( "/opt/homebrew/opt/python@{}/bin/python3" , version ) ) ,
104
- PathBuf :: from ( format ! ( "/opt/homebrew/opt/python@{}/bin/python{}" , version , version ) ) ,
102
+ PathBuf :: from ( format ! ( "/opt/homebrew/opt/python@3/bin/python{version}" ) ) ,
103
+ PathBuf :: from ( format ! ( "/opt/homebrew/opt/python@{version }/bin/python3" ) ) ,
104
+ PathBuf :: from ( format ! ( "/opt/homebrew/opt/python@{version }/bin/python{version}" ) ) ,
105
105
PathBuf :: from ( "/usr/local/opt/python@3/bin/python3" ) ,
106
- PathBuf :: from ( format ! ( "/usr/local/opt/python@3/bin/python{}" , version ) ) ,
106
+ PathBuf :: from ( format ! ( "/usr/local/opt/python@3/bin/python{version}" ) ) ,
107
107
// Check if this symlink is pointing to the same place as the resolved python exe
108
- PathBuf :: from ( format ! ( "/opt/homebrew/opt/python3/bin/python{}" , version ) ) ,
108
+ PathBuf :: from ( format ! ( "/opt/homebrew/opt/python3/bin/python{version}" ) ) ,
109
109
// Check if this symlink is pointing to the same place as the resolved python exe
110
110
PathBuf :: from ( "/opt/homebrew/bin/python3" ) ,
111
111
// Check if this symlink is pointing to the same place as the resolved python exe
@@ -148,21 +148,19 @@ pub fn get_known_symlinks_impl(
148
148
// 1. python 3.8 has sysprefix in /usr/local/Cellar/[email protected] /3.9.19/Frameworks/Python.framework/Versions/3.9
149
149
// 2. python 3.9 has sysprefix in /usr/local/opt/[email protected] /Frameworks/Python.framework/Versions/3.9
150
150
// 3. python 3.11 has sysprefix in /usr/local/opt/[email protected] /Frameworks/Python.framework/Versions/3.11
151
- PathBuf :: from ( format ! ( "/usr/local/opt/python@{}/bin/python3" , version ) ) ,
152
- PathBuf :: from ( format ! ( "/usr/local/opt/python@{}/bin/python{}" , version , version ) ) ,
151
+ PathBuf :: from ( format ! ( "/usr/local/opt/python@{version }/bin/python3" ) ) ,
152
+ PathBuf :: from ( format ! ( "/usr/local/opt/python@{version }/bin/python{version}" ) ) ,
153
153
PathBuf :: from ( "/usr/local/opt/python@3/bin/python3" ) ,
154
- PathBuf :: from ( format ! ( "/usr/local/opt/python@3/bin/python{}" , version ) ) ,
154
+ PathBuf :: from ( format ! ( "/usr/local/opt/python@3/bin/python{version}" ) ) ,
155
155
PathBuf :: from ( format ! (
156
- "/usr/local/Cellar/python@{}/{}/bin/python{}" ,
157
- version, full_version, version
156
+ "/usr/local/Cellar/python@{version}/{full_version}/bin/python{version}"
158
157
) ) ,
159
158
PathBuf :: from ( format ! (
160
- "/usr/local/Cellar/python@{}/{}/Frameworks/Python.framework/Versions/{}/bin/python{}" ,
161
- version, full_version, version, version
159
+ "/usr/local/Cellar/python@{version}/{full_version}/Frameworks/Python.framework/Versions/{version}/bin/python{version}"
162
160
) ) ,
163
161
// This is a special folder, if users install python using other means, this file
164
162
// might get overridden. So we should only add this if this files points to the same place
165
- PathBuf :: from ( format ! ( "/usr/local/bin/python{}" , version ) ) ,
163
+ PathBuf :: from ( format ! ( "/usr/local/bin/python{version}" ) ) ,
166
164
// Check if this symlink is pointing to the same place as the resolved python exe
167
165
PathBuf :: from ( "/usr/local/bin/python3" ) ,
168
166
// Check if this symlink is pointing to the same place as the resolved python exe
@@ -201,36 +199,30 @@ pub fn get_known_symlinks_impl(
201
199
let mut symlinks = vec ! [ symlink_resolved_python_exe. to_owned( ) ] ;
202
200
for possible_symlink in [
203
201
PathBuf :: from ( "/home/linuxbrew/.linuxbrew/bin/python3" ) ,
204
- PathBuf :: from ( format ! ( "/home/linuxbrew/.linuxbrew/bin/python{}" , version ) ) ,
202
+ PathBuf :: from ( format ! ( "/home/linuxbrew/.linuxbrew/bin/python{version}" ) ) ,
205
203
PathBuf :: from ( format ! (
206
- "/home/linuxbrew/.linuxbrew/Cellar/python@{}/{}/bin/python{}" ,
207
- version, full_version, version
204
+ "/home/linuxbrew/.linuxbrew/Cellar/python@{version}/{full_version}/bin/python{version}"
208
205
) ) ,
209
206
PathBuf :: from ( format ! (
210
- "/home/linuxbrew/.linuxbrew/Cellar/python@{}/{}/bin/python3" ,
211
- version, full_version
207
+ "/home/linuxbrew/.linuxbrew/Cellar/python@{version}/{full_version}/bin/python3"
212
208
) ) ,
213
209
PathBuf :: from ( format ! (
214
- "/home/linuxbrew/.linuxbrew/opt/python@{}/bin/python{}" ,
215
- version, version
210
+ "/home/linuxbrew/.linuxbrew/opt/python@{version}/bin/python{version}"
216
211
) ) ,
217
212
PathBuf :: from ( format ! (
218
- "/home/linuxbrew/.linuxbrew/opt/python@{}/bin/python3" ,
219
- version
213
+ "/home/linuxbrew/.linuxbrew/opt/python@{version}/bin/python3"
220
214
) ) ,
221
215
PathBuf :: from ( format ! (
222
- "/home/linuxbrew/.linuxbrew/opt/python3/bin/python{}" ,
223
- version
216
+ "/home/linuxbrew/.linuxbrew/opt/python3/bin/python{version}"
224
217
) ) ,
225
218
PathBuf :: from ( "/home/linuxbrew/.linuxbrew/opt/python3/bin/python3" ) ,
226
219
PathBuf :: from ( format ! (
227
- "/home/linuxbrew/.linuxbrew/opt/python@3/bin/python{}" ,
228
- version
220
+ "/home/linuxbrew/.linuxbrew/opt/python@3/bin/python{version}"
229
221
) ) ,
230
222
PathBuf :: from ( "/home/linuxbrew/.linuxbrew/opt/python@3/bin/python3" ) ,
231
223
// This is a special folder, if users install python using other means, this file
232
224
// might get overridden. So we should only add this if this files points to the same place
233
- PathBuf :: from ( format ! ( "/usr/local/bin/python{}" , version ) ) ,
225
+ PathBuf :: from ( format ! ( "/usr/local/bin/python{version}" ) ) ,
234
226
// Check if this symlink is pointing to the same place as the resolved python exe
235
227
PathBuf :: from ( "/usr/local/bin/python3" ) ,
236
228
// Check if this symlink is pointing to the same place as the resolved python exe
0 commit comments