mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix confusion between SDK paths when "use module SDK" option is selected and a Python SDK is configured (PY-9021)
This commit is contained in:
@@ -183,6 +183,15 @@ public abstract class AbstractPythonRunConfiguration<T extends AbstractRunConfig
|
||||
return sdkHome;
|
||||
}
|
||||
|
||||
public Sdk getSdk() {
|
||||
if (myUseModuleSdk) {
|
||||
return PythonSdkType.findPythonSdk(getModule());
|
||||
}
|
||||
else {
|
||||
return PythonSdkType.findSdkByPath(getSdkHome());
|
||||
}
|
||||
}
|
||||
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
super.readExternal(element);
|
||||
myInterpreterOptions = JDOMExternalizerUtil.readField(element, "INTERPRETER_OPTIONS");
|
||||
@@ -275,13 +284,13 @@ public abstract class AbstractPythonRunConfiguration<T extends AbstractRunConfig
|
||||
* @param commandLine what to patch
|
||||
*/
|
||||
public void patchCommandLine(GeneralCommandLine commandLine) {
|
||||
final String sdk_home = getSdkHome();
|
||||
Sdk sdk = PythonSdkType.findPythonSdk(getModule());
|
||||
if (sdk != null && sdk_home != null) {
|
||||
patchCommandLineFirst(commandLine, sdk_home);
|
||||
patchCommandLineForVirtualenv(commandLine, sdk_home);
|
||||
patchCommandLineForBuildout(commandLine, sdk_home);
|
||||
patchCommandLineLast(commandLine, sdk_home);
|
||||
final String interpreterPath = getInterpreterPath();
|
||||
Sdk sdk = getSdk();
|
||||
if (sdk != null && interpreterPath != null) {
|
||||
patchCommandLineFirst(commandLine, interpreterPath);
|
||||
patchCommandLineForVirtualenv(commandLine, interpreterPath);
|
||||
patchCommandLineForBuildout(commandLine, interpreterPath);
|
||||
patchCommandLineLast(commandLine, interpreterPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public abstract class PythonCommandLineState extends CommandLineState {
|
||||
|
||||
@Nullable
|
||||
public PythonSdkFlavor getSdkFlavor() {
|
||||
return PythonSdkFlavor.getFlavor(myConfig.getSdkHome());
|
||||
return PythonSdkFlavor.getFlavor(myConfig.getInterpreterPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,7 +150,7 @@ public abstract class PythonCommandLineState extends CommandLineState {
|
||||
PythonRunConfigurationExtensionsManager.getInstance()
|
||||
.patchCommandLine(myConfig, runnerSettings, commandLine, getConfigurationSettings().getRunnerId());
|
||||
|
||||
Sdk sdk = PythonSdkType.findSdkByPath(myConfig.getSdkHome());
|
||||
Sdk sdk = PythonSdkType.findSdkByPath(myConfig.getInterpreterPath());
|
||||
|
||||
|
||||
final ProcessHandler processHandler;
|
||||
|
||||
Reference in New Issue
Block a user