File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,21 @@ namespace PythonInstallation {
2323 pythonRoot = defaultPythonRoot ;
2424 }
2525
26+ // Consider third party file system providers
2627 const pythonRepositoryUri = Uri . parse ( pythonRepository ) ;
2728 if ( Uri . parse ( pythonRepository ) . authority !== 'github.com' ) {
28- return { repository : pythonRepositoryUri , root : '/' } ;
29+ const binaryLocation = Uri . joinPath ( pythonRepositoryUri , 'python.wasm' ) ;
30+ try {
31+ // fs.stat throws if file doesn't exist
32+ await workspace . fs . stat ( binaryLocation ) ;
33+ return { repository : pythonRepositoryUri , root : '/' } ;
34+ } catch {
35+ Tracer . append ( `python.wasm not found in ${ binaryLocation } . Falling back to default repository` ) ;
36+ pythonRepository = defaultPythonRepository ;
37+ pythonRoot = defaultPythonRoot ;
38+ }
2939 }
40+
3041 const extname = path . extname ( pythonRepository ) ;
3142 if ( extname === '.git' ) {
3243 pythonRepository = pythonRepository . substring ( 0 , pythonRepository . length - extname . length ) ;
You can’t perform that action at this time.
0 commit comments