Skip to content

Commit c2feff1

Browse files
committed
config: select python exe
spawn Python directly instead of the debugger script, which fixes an issue on Windows. Fixes #4.
1 parent 08f3aad commit c2feff1

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

lib/python-debugger-view.coffee

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,12 @@ class PythonDebuggerView extends View
104104
@addOutput(data_str.trim())
105105

106106
runBackendDebugger: ->
107-
args = [@debuggedFileName]
107+
args = [path.join(@backendDebuggerPath, @backendDebuggerName)]
108+
args.push(@debuggedFileName)
108109
args.push(arg) for arg in @debuggedFileArgs
109-
@backendDebugger = spawn path.join(@backendDebuggerPath, @backendDebuggerName), args
110+
python = atom.config.get "python-debugger.pythonExecutable"
111+
console.log("python-debugger: using", python)
112+
@backendDebugger = spawn python, args
110113

111114
for breakpoint in @breakpointStore.breakpoints
112115
@backendDebugger.stdin.write(breakpoint.toCommand() + "\n")

lib/python-debugger.coffee

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ module.exports = PythonDebugger =
66
pythonDebuggerView: null
77
subscriptions: null
88

9+
config:
10+
pythonExecutable:
11+
title: "Path to Python executable to use during debugging"
12+
type: "string"
13+
default: "python"
14+
915
createDebuggerView: (backendDebugger) ->
1016
unless @pythonDebuggerView?
1117
PythonDebuggerView = require "./python-debugger-view"

resources/atom_pdb.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# This is a simple customized pdb that has no prompt and outputs the
42
# name and line number of the file being debugged after each command.
53
# It is appropriate for a IDE-like debugger package in a text editor,

0 commit comments

Comments
 (0)