fixed PY-12690 Detected from creating virtualenv interpreter has invalid slashes

This commit is contained in:
Ekaterina Tuzova
2014-04-23 14:16:11 +04:00
parent c1d9f5f1ba
commit 4bc9f42f8b
@@ -272,16 +272,18 @@ public class CreateVirtualEnvDialog extends IdeaDialog {
FileChooser.chooseFiles(descriptor, myProject, suggestedDir, new FileChooser.FileChooserConsumer() {
@Override
public void consume(List<VirtualFile> selectedFiles) {
final String path = selectedFiles.get(0).getPath();
String path = selectedFiles.get(0).getPath();
if (sdkType.isValidSdkHome(path)) {
path = FileUtil.toSystemDependentName(path);
Sdk newSdk = null;
for (Sdk sdk : allSdks) {
if (path.equals(sdk.getHomePath())) {
newSdk = sdk;
}
}
if (newSdk == null)
if (newSdk == null) {
newSdk = new PyDetectedSdk(path);
}
consumer.consume(newSdk);
}
}