Skip to content

Commit 233dcc8

Browse files
authored
Fix Pyenv auto-selection on MacOS (#23132)
Resolves: #23123
1 parent b00c390 commit 233dcc8

File tree

1 file changed

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

1 file changed

+2
-5
lines changed

src/client/pythonEnvironments/common/environmentManagers/pyenv.ts

Lines changed: 2 additions & 5 deletions
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)