Skip to content

Commit

Permalink
Merge pull request #951 from zooba/issue-944-221
Browse files Browse the repository at this point in the history
Fixes #944 All environments disappeared
  • Loading branch information
zooba committed Nov 5, 2015
2 parents 0bfbf95 + fb0a07e commit 66584ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.IO;
using System.Reflection;
using Microsoft.PythonTools.Interpreter.Default;
using Microsoft.VisualStudioTools;

namespace Microsoft.PythonTools.Interpreter {
/// <summary>
Expand All @@ -32,7 +33,7 @@ public static PythonInterpreterFactoryWithDatabase CreateInterpreterFactory(Inte
var description = options.Description ?? string.Format("Unknown Python {0}", ver);
var prefixPath = options.PrefixPath;
if (string.IsNullOrEmpty(prefixPath) && !string.IsNullOrEmpty(options.InterpreterPath)) {
prefixPath = Path.GetDirectoryName(options.InterpreterPath);
prefixPath = CommonUtils.GetParent(options.InterpreterPath);
}

return new CPythonInterpreterFactory(
Expand Down
4 changes: 2 additions & 2 deletions Python/Product/EnvironmentsList/PipExtensionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private bool ShouldElevate {
public bool CanExecute {
get {
if (_factory == null || _factory.Configuration == null ||
string.IsNullOrEmpty(_factory.Configuration.InterpreterPath)) {
!File.Exists(_factory.Configuration.InterpreterPath)) {
return false;
}

Expand All @@ -254,7 +254,7 @@ public bool CanExecute {

private void AbortOnInvalidConfiguration() {
if (_factory == null || _factory.Configuration == null ||
string.IsNullOrEmpty(_factory.Configuration.InterpreterPath)) {
!File.Exists(_factory.Configuration.InterpreterPath)) {
throw new InvalidOperationException(Resources.MisconfiguredEnvironment);
}
}
Expand Down

0 comments on commit 66584ee

Please sign in to comment.