@@ -17,7 +17,6 @@ import { IDisposableRegistry } from '../types';
17
17
import { createDeferred , sleep } from '../utils/async' ;
18
18
import { noop } from '../utils/misc' ;
19
19
import { StopWatch } from '../utils/stopWatch' ;
20
- import * as internalPython from './internal/python' ;
21
20
import { ProcessService } from './proc' ;
22
21
import { PythonDaemonExecutionService } from './pythonDaemon' ;
23
22
import {
@@ -102,8 +101,7 @@ export class PythonDaemonExecutionServicePool implements IPythonDaemonExecutionS
102
101
return this . pythonExecutionService . getExecutionInfo ( pythonArgs ) ;
103
102
}
104
103
public async isModuleInstalled ( moduleName : string ) : Promise < boolean > {
105
- const args = internalPython . execModule ( moduleName , [ ] ) ;
106
- const msg = { args } ;
104
+ const msg = { args : [ '-m' , moduleName ] } ;
107
105
return this . wrapCall ( ( daemon ) => daemon . isModuleInstalled ( moduleName ) , msg ) ;
108
106
}
109
107
public async exec ( args : string [ ] , options : SpawnOptions ) : Promise < ExecutionResult < string > > {
@@ -112,11 +110,10 @@ export class PythonDaemonExecutionServicePool implements IPythonDaemonExecutionS
112
110
}
113
111
public async execModule (
114
112
moduleName : string ,
115
- moduleArgs : string [ ] ,
113
+ args : string [ ] ,
116
114
options : SpawnOptions
117
115
) : Promise < ExecutionResult < string > > {
118
- const args = internalPython . execModule ( moduleName , moduleArgs ) ;
119
- const msg = { args, options } ;
116
+ const msg = { args : [ '-m' , moduleName ] . concat ( args ) , options } ;
120
117
return this . wrapCall ( ( daemon ) => daemon . execModule ( moduleName , args , options ) , msg ) ;
121
118
}
122
119
public execObservable ( args : string [ ] , options : SpawnOptions ) : ObservableExecutionResult < string > {
@@ -125,11 +122,10 @@ export class PythonDaemonExecutionServicePool implements IPythonDaemonExecutionS
125
122
}
126
123
public execModuleObservable (
127
124
moduleName : string ,
128
- moduleArgs : string [ ] ,
125
+ args : string [ ] ,
129
126
options : SpawnOptions
130
127
) : ObservableExecutionResult < string > {
131
- const args = internalPython . execModule ( moduleName , moduleArgs ) ;
132
- const msg = { args, options } ;
128
+ const msg = { args : [ '-m' , moduleName ] . concat ( args ) , options } ;
133
129
return this . wrapObservableCall ( ( daemon ) => daemon . execModuleObservable ( moduleName , args , options ) , msg ) ;
134
130
}
135
131
/**
0 commit comments