Skip to content

Commit 0c413a7

Browse files
committed
Add builtin breakpoint (PEP 553)
Python 3.7 introduced new builtin function `breakpoint()` (PEP 553) that can be used to insert breakpoints.
1 parent 2da50da commit 0c413a7

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

autoload/pymode/breakpoint.vim

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ fun! pymode#breakpoint#init() "{{{
1111

1212
from importlib.util import find_spec
1313

14-
for module in ('wdb', 'pudb', 'ipdb', 'pdb'):
15-
if find_spec(module):
16-
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
17-
break
14+
if sys.version_info >= (3, 7):
15+
vim.command('let g:pymode_breakpoint_cmd = "breakpoint()"')
16+
17+
else:
18+
for module in ('wdb', 'pudb', 'ipdb', 'pdb'):
19+
if find_spec(module):
20+
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
21+
break
1822
EOF
1923
endif
2024

0 commit comments

Comments
 (0)