|
1 | | -import * as ch from 'child_process'; |
2 | 1 | import * as fs from 'fs-extra'; |
3 | 2 | import * as path from 'path'; |
4 | 3 | import { PassThrough } from 'stream'; |
5 | 4 | import { Disposable, ExtensionContext, LogOutputChannel, Uri } from 'vscode'; |
6 | 5 | import * as rpc from 'vscode-jsonrpc/node'; |
7 | 6 | import { PythonProjectApi } from '../../api'; |
| 7 | +import { spawnProcess } from '../../common/childProcess.apis'; |
8 | 8 | import { ENVS_EXTENSION_ID, PYTHON_EXTENSION_ID } from '../../common/constants'; |
9 | 9 | import { getExtension } from '../../common/extension.apis'; |
10 | 10 | import { traceError, traceLog, traceVerbose, traceWarn } from '../../common/logging'; |
@@ -213,7 +213,7 @@ class NativePythonFinderImpl implements NativePythonFinder { |
213 | 213 | const writable = new PassThrough(); |
214 | 214 | const disposables: Disposable[] = []; |
215 | 215 | try { |
216 | | - const proc = ch.spawn(this.toolPath, ['server'], { env: process.env }); |
| 216 | + const proc = spawnProcess(this.toolPath, ['server'], { env: process.env, stdio: 'pipe' }); |
217 | 217 | proc.stdout.pipe(readable, { end: false }); |
218 | 218 | proc.stderr.on('data', (data) => this.outputChannel.error(`[pet] ${data.toString()}`)); |
219 | 219 | writable.pipe(proc.stdin, { end: false }); |
|
0 commit comments