From f99dca7e11355a44cbb603cc772e52a39c8a8993 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pymode/__init__.py b/pymode/__init__.py index 2a5dac3d..7f599026 100644 --- a/pymode/__init__.py +++ b/pymode/__init__.py @@ -4,7 +4,11 @@ import sys import vim # noqa - +try: + from importlib.machinery import PathFinder as _PathFinder + vim.find_module = _PathFinder.find_module +except ImportError: + pass def auto(): """Fix PEP8 erorrs in current buffer.