Skip to content

Commit

Permalink
Fixes issue while trying to run / debug a pyramid application (#530)
Browse files Browse the repository at this point in the history
The debugger tries to find pserve on all platforms but on windows the correct file name should be pserve.exe.

Fixes #519
  • Loading branch information
jpfarias authored and DonJayamanne committed Jan 4, 2018
1 parent 4372809 commit 8f97908
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client/debugger/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { DebugClient } from "./DebugClients/DebugClient";
import { CreateAttachDebugClient, CreateLaunchDebugClient } from "./DebugClients/DebugFactory";
import { BaseDebugServer } from "./DebugServers/BaseDebugServer";
import { PythonProcess } from "./PythonProcess";
import { IS_WINDOWS } from './Common/Utils';

const CHILD_ENUMEARATION_TIMEOUT = 5000;

Expand Down Expand Up @@ -214,11 +215,12 @@ export class PythonDebugger extends DebugSession {
catch (ex) {
}
if (Array.isArray(args.debugOptions) && args.debugOptions.indexOf("Pyramid") >= 0) {
const pserve = IS_WINDOWS ? "pserve.exe" : "pserve";
if (fs.existsSync(args.pythonPath)) {
args.program = path.join(path.dirname(args.pythonPath), "pserve");
args.program = path.join(path.dirname(args.pythonPath), pserve);
}
else {
args.program = "pserve";
args.program = pserve;
}
}
// Confirm the file exists
Expand Down

0 comments on commit 8f97908

Please sign in to comment.