private static void buildPythonPath( Project project, GeneralCommandLine commandLine, PythonRunParams config) { Sdk pythonSdk = PythonSdkType.findSdkByPath(config.getSdkHome()); if (pythonSdk != null) { List<String> pathList = Lists.newArrayList(getAddedPaths(pythonSdk)); pathList.addAll(collectPythonPath(project, config)); initPythonPath(commandLine, config.isPassParentEnvs(), pathList, config.getSdkHome()); } }
@Nullable public static String getInterpreterPath(Project project, PythonRunParams config) { String sdkHome = config.getSdkHome(); if (config.isUseModuleSdk() || StringUtil.isEmpty(sdkHome)) { Module module = getModule(project, config); Sdk sdk = PythonSdkType.findPythonSdk(module); if (sdk == null) return null; sdkHome = sdk.getHomePath(); } return sdkHome; }