Skip to content

Commit 51c66fa

Browse files
authored
Merge pull request #1094 from fpob/python37-breakpoint
Add builtin breakpoint (PEP 553)
2 parents 2da50da + 0c413a7 commit 51c66fa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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)