Skip to content

Commit 148aaae

Browse files
author
Kartik Raj
committed
Handle error and rename
1 parent 87d84e6 commit 148aaae

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/client/pythonEnvironments/base/info/interpreter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type InterpreterInformation = {
2626
* @param python - the path to the Python executable
2727
* @param raw - the information returned by the `interpreterInfo.py` script
2828
*/
29-
export function extractPythonEnvInfo(python: string, raw: PythonEnvInfo): InterpreterInformation {
29+
function extractInterpreterInfo(python: string, raw: PythonEnvInfo): InterpreterInformation {
3030
const rawVersion = `${raw.versionInfo.slice(0, 3).join('.')}-${raw.versionInfo[3]}`;
3131
const version = parseVersion(rawVersion);
3232
version.sysVersion = raw.sysVersion;
@@ -89,5 +89,5 @@ export async function getInterpreterInfo(
8989
if (logger) {
9090
logger.info(`Found interpreter for ${argv}`);
9191
}
92-
return extractPythonEnvInfo(python.pythonExecutable, json);
92+
return extractInterpreterInfo(python.pythonExecutable, json);
9393
}

src/client/pythonEnvironments/info/environmentInfoService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export interface IEnvironmentInfoService {
2222
}
2323

2424
async function buildEnvironmentInfo(interpreterPath: string): Promise<InterpreterInformation | undefined> {
25-
const interpreterInfo = await getInterpreterInfo(buildPythonExecInfo(interpreterPath), shellExecute);
25+
const interpreterInfo = await getInterpreterInfo(buildPythonExecInfo(interpreterPath), shellExecute).catch(
26+
() => undefined,
27+
);
2628
if (interpreterInfo === undefined || interpreterInfo.version === undefined) {
2729
return undefined;
2830
}

0 commit comments

Comments
 (0)