File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1313 f"pip{ sys .version_info .major } .{ sys .version_info .minor } " ,
1414]
1515if WINDOWS :
16- _allowed_extensions = {"" , ".exe" , ".EXE" }
16+ _allowed_extensions = {"" , ".exe" }
1717 _EXECUTABLE_NAMES = [
1818 "" .join (parts )
1919 for parts in itertools .product (_EXECUTABLE_NAMES , _allowed_extensions )
@@ -50,10 +50,15 @@ def get_best_invocation_for_this_pip() -> str:
5050
5151 # Try to use pip[X[.Y]] names, if those executables for this environment are
5252 # the first on PATH with that name.
53- exe_are_in_PATH = binary_prefix in os .environ .get ("PATH" , "" ).split (os .pathsep )
53+ path_parts = os .path .normcase (os .environ .get ("PATH" , "" )).split (os .pathsep )
54+ exe_are_in_PATH = os .path .normcase (binary_prefix ) in path_parts
5455 if exe_are_in_PATH :
5556 for exe_name in _EXECUTABLE_NAMES :
56- if shutil .which (exe_name ) == os .path .join (binary_prefix , exe_name ):
57+ found_executable = shutil .which (exe_name )
58+ if found_executable and os .path .samefile (
59+ found_executable ,
60+ os .path .join (binary_prefix , exe_name ),
61+ ):
5762 return exe_name
5863
5964 # Use the `-m` invocation, if there's no "nice" invocation.
You can’t perform that action at this time.
0 commit comments