File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
src/client/pythonEnvironments
common/environmentManagers Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export interface IEnvironmentInfoService {
38
38
}
39
39
40
40
async function buildEnvironmentInfo ( env : PythonEnvInfo ) : Promise < InterpreterInformation | undefined > {
41
- const python = [ env . executable . filename , OUTPUT_MARKER_SCRIPT ] ;
41
+ const python = [ env . executable . filename , '-I' , OUTPUT_MARKER_SCRIPT ] ;
42
42
const interpreterInfo = await getInterpreterInfo ( buildPythonExecInfo ( python , undefined , env . executable . filename ) ) ;
43
43
return interpreterInfo ;
44
44
}
@@ -50,7 +50,7 @@ async function buildEnvironmentInfoUsingCondaRun(env: PythonEnvInfo): Promise<In
50
50
if ( ! condaEnv ) {
51
51
return undefined ;
52
52
}
53
- const python = await conda ?. getRunPythonArgs ( condaEnv , true ) ;
53
+ const python = await conda ?. getRunPythonArgs ( condaEnv , true , true ) ;
54
54
if ( ! python ) {
55
55
return undefined ;
56
56
}
Original file line number Diff line number Diff line change @@ -506,7 +506,11 @@ export class Conda {
506
506
return 'python' ;
507
507
}
508
508
509
- public async getRunPythonArgs ( env : CondaEnvInfo , forShellExecution ?: boolean ) : Promise < string [ ] | undefined > {
509
+ public async getRunPythonArgs (
510
+ env : CondaEnvInfo ,
511
+ forShellExecution ?: boolean ,
512
+ isolatedFlag = false ,
513
+ ) : Promise < string [ ] | undefined > {
510
514
const condaVersion = await this . getCondaVersion ( ) ;
511
515
if ( condaVersion && lt ( condaVersion , CONDA_RUN_VERSION ) ) {
512
516
traceError ( '`conda run` is not supported for conda version' , condaVersion . raw ) ;
@@ -518,14 +522,17 @@ export class Conda {
518
522
} else {
519
523
args . push ( '-p' , env . prefix ) ;
520
524
}
521
- return [
525
+ const python = [
522
526
forShellExecution ? this . shellCommand : this . command ,
523
527
'run' ,
524
528
...args ,
525
529
'--no-capture-output' ,
526
530
'python' ,
527
- OUTPUT_MARKER_SCRIPT ,
528
531
] ;
532
+ if ( isolatedFlag ) {
533
+ python . push ( '-I' ) ;
534
+ }
535
+ return [ ...python , OUTPUT_MARKER_SCRIPT ] ;
529
536
}
530
537
531
538
/**
You can’t perform that action at this time.
0 commit comments