@@ -18,14 +18,12 @@ const VALID_DEBUG_OPTIONS = [
1818 'DjangoDebugging' ] ;
1919
2020export class LocalDebugClient extends DebugClient {
21- protected args : LaunchRequestArguments ;
2221 protected pyProc : child_process . ChildProcess ;
2322 protected pythonProcess : IPythonProcess ;
2423 protected debugServer : BaseDebugServer ;
2524 // tslint:disable-next-line:no-any
2625 constructor ( args : any , debugSession : DebugSession , private canLaunchTerminal : boolean ) {
2726 super ( args , debugSession ) ;
28- this . args = args ;
2927 }
3028
3129 public CreateDebugServer ( pythonProcess : IPythonProcess ) : BaseDebugServer {
@@ -170,16 +168,6 @@ export class LocalDebugClient extends DebugClient {
170168 private launchExternalTerminal ( sudo : boolean , cwd : string , pythonPath : string , args : string [ ] , env : { } ) {
171169 return new Promise ( ( resolve , reject ) => {
172170 if ( this . canLaunchTerminal ) {
173- open ( { wait : false , app : [ pythonPath ] . concat ( args ) , cwd, env, sudo : sudo } ) . then ( proc => {
174- this . pyProc = proc ;
175- resolve ( ) ;
176- } , error => {
177- if ( ! this . debugServer && this . debugServer . IsRunning ) {
178- return ;
179- }
180- reject ( error ) ;
181- } ) ;
182- } else {
183171 const command = sudo ? 'sudo' : pythonPath ;
184172 const commandArgs = sudo ? [ pythonPath ] . concat ( args ) : args ;
185173 const isExternalTerminal = this . args . console === 'externalTerminal' ;
@@ -198,6 +186,16 @@ export class LocalDebugClient extends DebugClient {
198186 reject ( response ) ;
199187 }
200188 } ) ;
189+ } else {
190+ open ( { wait : false , app : [ pythonPath ] . concat ( args ) , cwd, env, sudo : sudo } ) . then ( proc => {
191+ this . pyProc = proc ;
192+ resolve ( ) ;
193+ } , error => {
194+ if ( ! this . debugServer && this . debugServer . IsRunning ) {
195+ return ;
196+ }
197+ reject ( error ) ;
198+ } ) ;
201199 }
202200 } ) ;
203201 }
0 commit comments