Skip to content

Commit

Permalink
Fix warning that repeatedly shows up (#7731)
Browse files Browse the repository at this point in the history
* update versions exposed to users

* fix warning repeatedly showing up

* update debugpy version
  • Loading branch information
StellaHuang95 authored Oct 18, 2023
1 parent 1fd6cab commit b72355d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Build/debugpy-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.7
1.8.0
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,6 @@ private LanguageServerSettings.PythonSettings GetSettings(Uri scopeUri = null)
PythonConstants.TypeCheckingModeSetting, null, Site, PythonWorkspaceContextProvider.Workspace, out _)
?? _analysisOptions.TypeCheckingMode;

var ver3 = new Version(3, 0);
var version = context.InterpreterConfiguration.Version;
// show a warning if the python version is not supported
if (version.ToLanguageVersion() == PythonLanguageVersion.None)
{
MessageBox.ShowWarningMessage(Site, Strings.PythonVersionNotSupportedInfoBarText.FormatUI(context.InterpreterConfiguration.Description));
}
else if (context.InterpreterConfiguration.Version < ver3)
{
MessageBox.ShowWarningMessage(Site, Strings.WarningPython2NotSupported);
}

// get task list tokens from options
var taskListTokens = new List<LanguageServerSettings.PythonSettings.PythonAnalysisSettings.TaskListToken>();
var taskListService = Site.GetService<SVsTaskList, ITaskList>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using Microsoft.Build.Execution;
using Microsoft.PythonTools.Commands;
using Microsoft.PythonTools.Common;
using Microsoft.PythonTools.Common.Parsing;
using Microsoft.PythonTools.Environments;
using Microsoft.PythonTools.Infrastructure;
using Microsoft.PythonTools.Interpreter;
Expand Down Expand Up @@ -273,6 +274,14 @@ internal set {
MSBuildConstants.InterpreterIdProperty,
ReplaceMSBuildPath(_active.Configuration.Id)
);
var ver3 = new Version(3, 0);
var version = _active.Configuration.Version;
// show a warning if the python version is not supported
if (version.ToLanguageVersion() == PythonLanguageVersion.None) {
Utility.MessageBox.ShowWarningMessage(Site, Strings.PythonVersionNotSupportedInfoBarText.FormatUI(_active.Configuration.Description));
} else if (_active.Configuration.Version < ver3) {
Utility.MessageBox.ShowWarningMessage(Site, Strings.WarningPython2NotSupported);
}
} else {
BuildProject.SetProperty(MSBuildConstants.InterpreterIdProperty, "");
}
Expand Down

0 comments on commit b72355d

Please sign in to comment.