IInterpreterManager relatedInterpreterManager = getRelatedInterpreterManager();
if (relatedInterpreterManager == null) {
if (IN_TESTS) {
return null;
}
throw new ProjectMisconfiguredException("Did not expect the interpreter manager to be null.");
}
if (IPythonNature.DEFAULT_INTERPRETER.equals(projectInterpreterName)) {
//if it's the default, let's translate it to the outside world
ret = relatedInterpreterManager.getDefaultInterpreterInfo(true);
} else {
ret = relatedInterpreterManager.getInterpreterInfo(projectInterpreterName, null);
}
if (ret == null) {
final IProject p = this.getProject();
final String projectName;
if (p != null) {
projectName = p.getName();
} else {
projectName = "null";
}
String msg = "Invalid interpreter: " + projectInterpreterName + " configured for project: "
+ projectName + ".";
ProjectMisconfiguredException e = new ProjectMisconfiguredException(msg);
Log.log(e);
throw e;
} else {
return ret;
}
} catch (CoreException e) {
throw new ProjectMisconfiguredException(e);
}
}