Skip to content

Commit 63fd864

Browse files
authored
Put back the daemon code. It's not actually starting a python process. (#11038)
1 parent 03e3a0d commit 63fd864

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

news/2 Fixes/11035.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Jupyter notebooks and interactive window crashing on startup.

src/client/common/process/pythonDaemonPool.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { IDisposableRegistry } from '../types';
1717
import { createDeferred, sleep } from '../utils/async';
1818
import { noop } from '../utils/misc';
1919
import { StopWatch } from '../utils/stopWatch';
20-
import * as internalPython from './internal/python';
2120
import { ProcessService } from './proc';
2221
import { PythonDaemonExecutionService } from './pythonDaemon';
2322
import {
@@ -102,8 +101,7 @@ export class PythonDaemonExecutionServicePool implements IPythonDaemonExecutionS
102101
return this.pythonExecutionService.getExecutionInfo(pythonArgs);
103102
}
104103
public async isModuleInstalled(moduleName: string): Promise<boolean> {
105-
const args = internalPython.execModule(moduleName, []);
106-
const msg = { args };
104+
const msg = { args: ['-m', moduleName] };
107105
return this.wrapCall((daemon) => daemon.isModuleInstalled(moduleName), msg);
108106
}
109107
public async exec(args: string[], options: SpawnOptions): Promise<ExecutionResult<string>> {
@@ -112,11 +110,10 @@ export class PythonDaemonExecutionServicePool implements IPythonDaemonExecutionS
112110
}
113111
public async execModule(
114112
moduleName: string,
115-
moduleArgs: string[],
113+
args: string[],
116114
options: SpawnOptions
117115
): Promise<ExecutionResult<string>> {
118-
const args = internalPython.execModule(moduleName, moduleArgs);
119-
const msg = { args, options };
116+
const msg = { args: ['-m', moduleName].concat(args), options };
120117
return this.wrapCall((daemon) => daemon.execModule(moduleName, args, options), msg);
121118
}
122119
public execObservable(args: string[], options: SpawnOptions): ObservableExecutionResult<string> {
@@ -125,11 +122,10 @@ export class PythonDaemonExecutionServicePool implements IPythonDaemonExecutionS
125122
}
126123
public execModuleObservable(
127124
moduleName: string,
128-
moduleArgs: string[],
125+
args: string[],
129126
options: SpawnOptions
130127
): ObservableExecutionResult<string> {
131-
const args = internalPython.execModule(moduleName, moduleArgs);
132-
const msg = { args, options };
128+
const msg = { args: ['-m', moduleName].concat(args), options };
133129
return this.wrapObservableCall((daemon) => daemon.execModuleObservable(moduleName, args, options), msg);
134130
}
135131
/**

0 commit comments

Comments
 (0)