python interpreter should be at least executable but not necessarily called python; PY-60259; PY-11992

(cherry picked from commit a9dd773947b75e850c1e74e209bec9330ae8d74f)

IJ-MR-143222

GitOrigin-RevId: 16f075b18210dbd73a8e04e86282064048c06b99
This commit is contained in:
Aleksandr Sorotskii
2024-08-23 17:34:59 +02:00
committed by intellij-monorepo-bot
parent ba81251f81
commit 1cb0659dad
3 changed files with 12 additions and 13 deletions

View File

@@ -330,7 +330,7 @@ public abstract class PythonSdkFlavor<D extends PyFlavorData> {
* It only validates path for local target, hence use {@link #sdkSeemsValid(Sdk, PyFlavorData, TargetEnvironmentConfiguration)} instead
*/
public boolean isValidSdkPath(@NotNull Path path) {
return StringUtil.toLowerCase(FileUtilRt.getNameWithoutExtension(path.getFileName().toString())).contains("python");
return Files.exists(path) && Files.isExecutable(path);
}
@Nullable