[python] IJPL-165 Get rid of creating SDK with the same path twice

In python tests we have cases when SDK which was previously created at `com.jetbrains.env.PyEnvTaskRunner.getSdk` created one more time at `com.jetbrains.env.PyEnvTaskRunner#runTask:104`. So, simple check was added to avoid such cases

GitOrigin-RevId: 8a4836182861dd8421b728b4361977cad68fcbf3
This commit is contained in:
Mikhail Mazurkevich
2023-12-14 20:28:48 +04:00
committed by intellij-monorepo-bot
parent 435955aad0
commit 3dc9ebfec4

View File

@@ -46,8 +46,10 @@ public abstract class CreateConfigurationTask<T extends AbstractPythonRunConfigu
@Override
public void runTestOn(@NotNull final String sdkHome, @Nullable Sdk existingSdk) throws InvalidSdkException {
createTempSdk(sdkHome, SdkCreationType.SDK_PACKAGES_ONLY);
if (!existingSdk.getHomePath().equals(sdkHome)) {
// Creates SDK that doesn't exist yet
createTempSdk(sdkHome, SdkCreationType.SDK_PACKAGES_ONLY);
}
ApplicationManager.getApplication().invokeAndWait(() -> ApplicationManager.getApplication().runWriteAction(() -> {
for (final PsiElement elementToRightClickOn : getPsiElementsToRightClickOn()) {