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

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy