Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update breakpoint module to use python find_spec instead of find_module #1139

Copy link
Copy link
@Toure

Description

@Toure
Issue body actions

Python find_module function has been deprecated as of py3.4 and find_spec is the replacement, it contains the same interface and will fix the error message received when opening a python file in vim-python-mode:

diff --git a/autoload/pymode/breakpoint.vim b/autoload/pymode/breakpoint.vim
index c3189aa..e62c041 100644
--- a/autoload/pymode/breakpoint.vim
+++ b/autoload/pymode/breakpoint.vim
@@ -15,11 +15,11 @@ fun! pymode#breakpoint#init() "{{{
 
         PymodePython << EOF
 
-from imp import find_module
+from importlib.util import find_spec
 
 for module in ('wdb', 'pudb', 'ipdb'):
     try:
-        find_module(module)
+        find_spec(module)
         vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace()  # XXX BREAKPOINT"' % (module, module))
         break
     except ImportError:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.