File tree Expand file tree Collapse file tree
src/client/pythonEnvironments
common/environmentManagers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export interface IEnvironmentInfoService {
3838}
3939
4040async 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 ] ;
4242 const interpreterInfo = await getInterpreterInfo ( buildPythonExecInfo ( python , undefined , env . executable . filename ) ) ;
4343 return interpreterInfo ;
4444}
@@ -50,7 +50,7 @@ async function buildEnvironmentInfoUsingCondaRun(env: PythonEnvInfo): Promise<In
5050 if ( ! condaEnv ) {
5151 return undefined ;
5252 }
53- const python = await conda ?. getRunPythonArgs ( condaEnv , true ) ;
53+ const python = await conda ?. getRunPythonArgs ( condaEnv , true , true ) ;
5454 if ( ! python ) {
5555 return undefined ;
5656 }
Original file line number Diff line number Diff line change @@ -506,7 +506,11 @@ export class Conda {
506506 return 'python' ;
507507 }
508508
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 > {
510514 const condaVersion = await this . getCondaVersion ( ) ;
511515 if ( condaVersion && lt ( condaVersion , CONDA_RUN_VERSION ) ) {
512516 traceError ( '`conda run` is not supported for conda version' , condaVersion . raw ) ;
@@ -518,14 +522,17 @@ export class Conda {
518522 } else {
519523 args . push ( '-p' , env . prefix ) ;
520524 }
521- return [
525+ const python = [
522526 forShellExecution ? this . shellCommand : this . command ,
523527 'run' ,
524528 ...args ,
525529 '--no-capture-output' ,
526530 'python' ,
527- OUTPUT_MARKER_SCRIPT ,
528531 ] ;
532+ if ( isolatedFlag ) {
533+ python . push ( '-I' ) ;
534+ }
535+ return [ ...python , OUTPUT_MARKER_SCRIPT ] ;
529536 }
530537
531538 /**
You can’t perform that action at this time.
0 commit comments