Skip to content

Commit fabba0a

Browse files
committed
fix #546
1 parent fa98277 commit fabba0a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"stopOnEntry": true,
494494
"pythonPath": "${config.python.pythonPath}",
495495
"program": "${workspaceRoot}/manage.py",
496-
"cwd": "null",
496+
"cwd": "${workspaceRoot}",
497497
"args": [
498498
"runserver",
499499
"--noreload"
@@ -512,7 +512,7 @@
512512
"stopOnEntry": false,
513513
"pythonPath": "${config.python.pythonPath}",
514514
"program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter",
515-
"cwd": "null",
515+
"cwd": "${workspaceRoot}",
516516
"env": {
517517
"FLASK_APP": "${workspaceRoot}/quickstart/app.py"
518518
},
@@ -534,7 +534,7 @@
534534
"stopOnEntry": false,
535535
"pythonPath": "${config.python.pythonPath}",
536536
"program": "${workspaceRoot}/run.py",
537-
"cwd": "null",
537+
"cwd": "${workspaceRoot}",
538538
"args": [],
539539
"debugOptions": [
540540
"WaitOnAbnormalExit",
@@ -549,7 +549,7 @@
549549
"stopOnEntry": true,
550550
"pythonPath": "${config.python.pythonPath}",
551551
"program": "${workspaceRoot}/console.py",
552-
"cwd": "null",
552+
"cwd": "${workspaceRoot}",
553553
"args": [
554554
"dev",
555555
"runserver",

src/client/debugger/Main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class PythonDebugger extends DebugSession {
8282

8383
private startDebugServer(): Promise<IDebugServer> {
8484
let programDirectory = this.launchArgs ? path.dirname(this.launchArgs.program) : this.attachArgs.localRoot;
85-
if (this.launchArgs && typeof this.launchArgs.cwd === 'string' && this.launchArgs.cwd.length > 0) {
85+
if (this.launchArgs && typeof this.launchArgs.cwd === 'string' && this.launchArgs.cwd.length > 0 && this.launchArgs.cwd !== 'null') {
8686
programDirectory = this.launchArgs.cwd;
8787
}
8888
this.pythonProcess = new PythonProcess(0, "", programDirectory);
@@ -188,7 +188,7 @@ export class PythonDebugger extends DebugSession {
188188
}
189189
else {
190190
// When using modules ensure the cwd has been provided
191-
if (typeof args.cwd !== 'string' || args.cwd.length === 0) {
191+
if (typeof args.cwd !== 'string' || args.cwd.length === 0 || this.launchArgs.cwd === 'null') {
192192
return this.sendErrorResponse(response, 2001, `'cwd' in 'launch.json' needs to point to the working directory`);
193193
}
194194
}

0 commit comments

Comments
 (0)