File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -179,12 +179,12 @@ def find_compatible_pythons(
179179 for p in ignore_pythons or []:
180180 ignore_list .extend (glob .glob (p ))
181181 exenames = [
182- # "python3.11",
182+ "python3" , # system Python
183+ "python3.11" ,
183184 "python3.10" ,
184185 "python3.9" ,
185186 "python3.8" ,
186187 "python3.7" ,
187- "python3" ,
188188 "python" ,
189189 ]
190190 if util .IS_WINDOWS :
@@ -196,8 +196,12 @@ def find_compatible_pythons(
196196 if not os .path .isfile (os .path .join (path , exe )):
197197 continue
198198 candidates .append (os .path .join (path , exe ))
199- if sys .executable not in candidates :
200- candidates .insert (0 , sys .executable )
199+
200+ if sys .executable in candidates :
201+ candidates .remove (sys .executable )
202+ # put current Python to the top of list
203+ candidates .insert (0 , sys .executable )
204+
201205 result = []
202206 for item in candidates :
203207 if item in ignore_list :
You can’t perform that action at this time.
0 commit comments