From 645c85fe58f76675ae93e84e71cbb2853aaa5e04 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Sun, 8 Sep 2013 21:04:26 +0400 Subject: [PATCH] added search for executable if sdk home path is a symlink --- python/src/com/jetbrains/python/sdk/PythonSdkType.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkType.java b/python/src/com/jetbrains/python/sdk/PythonSdkType.java index 543f251c0723..5f2889ba49d9 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkType.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkType.java @@ -31,6 +31,7 @@ import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.io.FileSystemUtil; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.CharFilter; import com.intellij.openapi.util.text.StringUtil; @@ -883,6 +884,12 @@ public class PythonSdkType extends SdkType { runner = new File(new File(new File(binDir.getParentFile(), "local"), "bin"), name); if (runner.exists()) return LocalFileSystem.getInstance().extractPresentableUrl(runner.getPath()); + // if interpreter is a symlink + if (FileSystemUtil.isSymLink(homeDirectory)) { + String resolvedPath = FileSystemUtil.resolveSymLink(homeDirectory); + if (resolvedPath != null) + return getExecutablePath(resolvedPath, name); + } // Search in standard unix path runner = new File(new File("/usr", "bin"), name); if (runner.exists()) return LocalFileSystem.getInstance().extractPresentableUrl(runner.getPath());