File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/client/interpreter/locators Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change
1
+ Use node FS APIs when searching for python. This is a temporary change until VSC FS APIs are fixed.
Original file line number Diff line number Diff line change
1
+ import * as fsapi from 'fs-extra' ;
1
2
import { inject , injectable } from 'inversify' ;
2
3
import * as path from 'path' ;
3
4
import { traceError } from '../../common/logger' ;
@@ -8,13 +9,15 @@ import { IPipEnvServiceHelper } from './types';
8
9
9
10
const CheckPythonInterpreterRegEx = IS_WINDOWS ? / ^ p y t h o n ( \d + ( .\d + ) ? ) ? \. e x e $ / : / ^ p y t h o n ( \d + ( .\d + ) ? ) ? $ / ;
10
11
11
- export async function lookForInterpretersInDirectory ( pathToCheck : string , fs : IFileSystem ) : Promise < string [ ] > {
12
+ export async function lookForInterpretersInDirectory ( pathToCheck : string , _ : IFileSystem ) : Promise < string [ ] > {
12
13
// Technically, we should be able to use fs.getFiles(). However,
13
14
// that breaks some tests. So we stick with the broader behavior.
14
15
try {
15
- const subDirs = await fs . listdir ( pathToCheck ) ;
16
- return subDirs
17
- . map ( ( [ filename , _ft ] ) => filename )
16
+ // tslint:disable-next-line: no-suspicious-comment
17
+ // TODO https://github.com/microsoft/vscode-python/issues/11338
18
+ const files = await fsapi . readdir ( pathToCheck ) ;
19
+ return files
20
+ . map ( ( filename ) => path . join ( pathToCheck , filename ) )
18
21
. filter ( ( fileName ) => CheckPythonInterpreterRegEx . test ( path . basename ( fileName ) ) ) ;
19
22
} catch ( err ) {
20
23
traceError ( 'Python Extension (lookForInterpretersInDirectory.fs.listdir):' , err ) ;
You can’t perform that action at this time.
0 commit comments