@@ -186,28 +186,28 @@ export class InterpreterService implements Disposable, IInterpreterService {
186
186
// However we need not wait on the update to take place, as we can use the value directly.
187
187
if ( ! path ) {
188
188
path = this . configService . getSettings ( resource ) . pythonPath ;
189
- }
190
- if ( pathUtils . basename ( path ) === path ) {
191
- // Value can be `python`, `python3`, `python3.9` etc.
192
- // Note the following triggers autoselection if no interpreter is explictly
193
- // selected, i.e the value is `python`.
194
- // During shutdown we might not be able to get items out of the service container.
195
- const pythonExecutionFactory = this . serviceContainer . tryGet < IPythonExecutionFactory > (
196
- IPythonExecutionFactory ,
197
- ) ;
198
- const pythonExecutionService = pythonExecutionFactory
199
- ? await pythonExecutionFactory . create ( { resource } )
200
- : undefined ;
201
- const fullyQualifiedPath = pythonExecutionService
202
- ? await pythonExecutionService . getExecutablePath ( ) . catch ( ( ex ) => {
203
- traceError ( ex ) ;
204
- } )
205
- : undefined ;
206
- // Python path is invalid or python isn't installed.
207
- if ( ! fullyQualifiedPath ) {
208
- return undefined ;
189
+ if ( pathUtils . basename ( path ) === path ) {
190
+ // Value can be `python`, `python3`, `python3.9` etc.
191
+ // Note the following triggers autoselection if no interpreter is explictly
192
+ // selected, i.e the value is `python`.
193
+ // During shutdown we might not be able to get items out of the service container.
194
+ const pythonExecutionFactory = this . serviceContainer . tryGet < IPythonExecutionFactory > (
195
+ IPythonExecutionFactory ,
196
+ ) ;
197
+ const pythonExecutionService = pythonExecutionFactory
198
+ ? await pythonExecutionFactory . create ( { resource } )
199
+ : undefined ;
200
+ const fullyQualifiedPath = pythonExecutionService
201
+ ? await pythonExecutionService . getExecutablePath ( ) . catch ( ( ex ) => {
202
+ traceError ( ex ) ;
203
+ } )
204
+ : undefined ;
205
+ // Python path is invalid or python isn't installed.
206
+ if ( ! fullyQualifiedPath ) {
207
+ return undefined ;
208
+ }
209
+ path = fullyQualifiedPath ;
209
210
}
210
- path = fullyQualifiedPath ;
211
211
}
212
212
return this . getInterpreterDetails ( path ) ;
213
213
}
0 commit comments