mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user