From 2565ed7c961156f1bfce46a149086afbcd43ffda Mon Sep 17 00:00:00 2001 From: gryf Date: Mon, 13 Mar 2017 20:54:01 +0100 Subject: [PATCH] Be silent in case of lack of pylint --- ftplugin/python/pylint_fn.py | 6 +++++- ftplugin/python/pylint_fn.vim | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ftplugin/python/pylint_fn.py b/ftplugin/python/pylint_fn.py index 6772983..3a4d1f8 100644 --- a/ftplugin/python/pylint_fn.py +++ b/ftplugin/python/pylint_fn.py @@ -9,7 +9,7 @@ try: from pylint import lint from pylint.reporters.text import TextReporter except ImportError: - raise AssertionError('Error: pylint_fm.vim requires module pylint') + pylint = None import vim @@ -25,6 +25,10 @@ class VImPylint(object): def run(self): """execute pylint and fill the quickfix""" + if not pylint: + vim.command("echo 'Error: pylint_fm.vim requires module pylint'") + return + # clear QF window vim.command('call setqflist([])') diff --git a/ftplugin/python/pylint_fn.vim b/ftplugin/python/pylint_fn.vim index 69d4e2a..17a7dfc 100644 --- a/ftplugin/python/pylint_fn.vim +++ b/ftplugin/python/pylint_fn.vim @@ -46,7 +46,7 @@ let s:plugin_path = expand(':p:h', 1) -if exists(":Pep8") +if exists(":Pylint") finish " only load once endif