Skip to content

Commit

Permalink
Merge pull request #1094 from fpob/python37-breakpoint
Browse files Browse the repository at this point in the history
Add builtin breakpoint (PEP 553)
  • Loading branch information
diraol committed Jun 6, 2020
2 parents 2da50da + 0c413a7 commit 51c66fa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions autoload/pymode/breakpoint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ fun! pymode#breakpoint#init() "{{{

from importlib.util import find_spec

for module in ('wdb', 'pudb', 'ipdb', 'pdb'):
if find_spec(module):
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
break
if sys.version_info >= (3, 7):
vim.command('let g:pymode_breakpoint_cmd = "breakpoint()"')

else:
for module in ('wdb', 'pudb', 'ipdb', 'pdb'):
if find_spec(module):
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
break
EOF
endif

Expand Down

0 comments on commit 51c66fa

Please sign in to comment.