Skip to content

Commit

Permalink
Do not use -I flag in case we're unable to find encodings module …
Browse files Browse the repository at this point in the history
…when validating python (#20803)

Closes #20793
  • Loading branch information
Kartik Raj authored Mar 6, 2023
1 parent 2442dfb commit 672d07e
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,16 @@ class EnvironmentInfoService implements IEnvironmentInfoService {
return undefined;
});
} else if (reason) {
if (reason.message.includes('Unknown option: -I')) {
if (
reason.message.includes('Unknown option: -I') ||
reason.message.includes("ModuleNotFoundError: No module named 'encodings'")
) {
traceWarn(reason);
traceError(
'Support for Python 2.7 has been dropped by the Python extension so certain features may not work, upgrade to using Python 3.',
);
if (reason.message.includes('Unknown option: -I')) {
traceError(
'Support for Python 2.7 has been dropped by the Python extension so certain features may not work, upgrade to using Python 3.',
);
}
return buildEnvironmentInfo(env, false).catch((err) => {
traceError(err);
return undefined;
Expand Down

0 comments on commit 672d07e

Please sign in to comment.