Skip to content

Commit 0910d5d

Browse files
committed
Use pudb if available.
1 parent b282f82 commit 0910d5d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

ftplugin/python/init-pymode.vim

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,19 @@ endif
155155

156156
if !pymode#Default("g:pymode_breakpoint", 1) || g:pymode_breakpoint
157157

158-
if !pymode#Default("g:pymode_breakpoint_cmd", "import ipdb; ipdb.set_trace() # XXX BREAKPOINT") && has("python")
158+
if !pymode#Default("g:pymode_breakpoint_cmd", "import pdb; pdb.set_trace() # XXX BREAKPOINT") && has("python")
159+
159160
python << EOF
160161
from imp import find_module
161-
try:
162-
find_module('ipdb')
163-
except ImportError:
164-
vim.command('let g:pymode_breakpoint_cmd = "import pdb; pdb.set_trace() # XXX BREAKPOINT"')
162+
163+
for module in ('pudb', 'ipdb'):
164+
try:
165+
find_module(module)
166+
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
167+
except ImportError:
168+
continue
165169
EOF
170+
166171
endif
167172

168173
" OPTION: g:pymode_breakpoint_key -- string. Key for set/unset breakpoint.

0 commit comments

Comments
 (0)