Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If settings contains an {invalid,unsupported} python version, properly clear it from settings #155

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/utils/pythonHelper.mts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export default async function findPython(): Promise<string | undefined> {
"python path or it is not supported:",
version
);
// TODO: clear python path from settings
// if version is not supported, clear the path
await Settings.getInstance()?.updateGlobal(
SettingsKey.python3Path,
undefined
);
}
} catch (error) {
Logger.warn(
Expand All @@ -75,6 +79,18 @@ export default async function findPython(): Promise<string | undefined> {
);
}
}
// if path does not exist, clear it
else {
Logger.warn(
LoggerSource.pythonHelper,
"Python path set in user settings does not exist:",
pythonPath
);
await Settings.getInstance()?.updateGlobal(
SettingsKey.python3Path,
undefined
);
SConaway marked this conversation as resolved.
Show resolved Hide resolved
}
}

// Check python extension for any python environments with version >= 3.9
Expand Down
Loading