From 3d7bed2a9cdcef42deef5c5a29aa29ab467e0679 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 11 May 2019 12:44:44 -0300 Subject: [PATCH] Possibly fixing vim/python import machinery error This is a possible fix for #972. And it was based on https://github.com/pypa/setuptools/pull/1563#issuecomment-463801572 --- pymode/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pymode/__init__.py b/pymode/__init__.py index 2a5dac3d..ef548a45 100644 --- a/pymode/__init__.py +++ b/pymode/__init__.py @@ -4,7 +4,12 @@ import sys import vim # noqa - +try: + from importlib.machinery import PathFinder as _PathFinder + if not hasattr(vim, 'find_module'): + vim.find_module = _PathFinder.find_module +except ImportError: + pass def auto(): """Fix PEP8 erorrs in current buffer.