Dmitry Jemerov
2010-02-19 15:45:29 +03:00
parent 0d8381da1e
commit 139529ac2d
3 changed files with 10 additions and 4 deletions
@@ -94,10 +94,12 @@ public abstract class AbstractPythonRunConfiguration extends ModuleBasedConfigur
return sdkHome;
}
@Nullable
public String getInterpreterPath() {
String sdkHome;
if (myUseModuleSdk) {
Sdk sdk = PythonSdkType.findPythonSdk(getModule());
if (sdk == null) return null;
sdkHome = sdk.getHomePath();
}
else {
@@ -84,7 +84,7 @@ public abstract class PythonCommandLineState extends CommandLineState {
return processHandler;
}
protected GeneralCommandLine generateCommandLine() {
protected GeneralCommandLine generateCommandLine() throws ExecutionException {
GeneralCommandLine commandLine = new GeneralCommandLine();
setRunnerPath(commandLine);
@@ -96,8 +96,12 @@ public abstract class PythonCommandLineState extends CommandLineState {
return commandLine;
}
protected void setRunnerPath(GeneralCommandLine commandLine) {
commandLine.setExePath(myConfig.getInterpreterPath());
protected void setRunnerPath(GeneralCommandLine commandLine) throws ExecutionException {
String interpreterPath = myConfig.getInterpreterPath();
if (interpreterPath == null) {
throw new ExecutionException("Cannot find Python interpreter for this run configuration");
}
commandLine.setExePath(interpreterPath);
}
protected void buildCommandLineParameters(GeneralCommandLine commandLine) {
@@ -47,7 +47,7 @@ public abstract class PythonTestCommandLineStateBase extends PythonCommandLineSt
return consoleView;
}
protected GeneralCommandLine generateCommandLine() {
protected GeneralCommandLine generateCommandLine() throws ExecutionException {
GeneralCommandLine cmd = new GeneralCommandLine();
setRunnerPath(cmd);