Skip to content

Commit bb90387

Browse files
anthonykim1wesm
authored andcommitted
Fix Pyenv auto-selection on MacOS (microsoft/vscode-python#23132)
Resolves: microsoft/vscode-python#23123
1 parent c55a3d5 commit bb90387

File tree

1 file changed

+2
-5
lines changed
  • extensions/positron-python/src/client/pythonEnvironments/common/environmentManagers

1 file changed

+2
-5
lines changed

extensions/positron-python/src/client/pythonEnvironments/common/environmentManagers/pyenv.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,17 @@ export function getPyenvDir(): string {
2121
return pyenvDir;
2222
}
2323

24-
async function getPyenvBinary(): Promise<string | undefined> {
24+
async function getPyenvBinary(): Promise<string> {
2525
const pyenvDir = getPyenvDir();
2626
const pyenvBin = path.join(pyenvDir, 'bin', 'pyenv');
2727
if (await pathExists(pyenvBin)) {
2828
return pyenvBin;
2929
}
30-
return undefined;
30+
return 'pyenv';
3131
}
3232

3333
export async function getActivePyenvForDirectory(cwd: string): Promise<string | undefined> {
3434
const pyenvBin = await getPyenvBinary();
35-
if (!pyenvBin) {
36-
return undefined;
37-
}
3835
try {
3936
const pyenvInterpreterPath = await shellExecute(`${pyenvBin} which python`, { cwd });
4037
return pyenvInterpreterPath.stdout.trim();

0 commit comments

Comments
 (0)