From c8474c279d08467465d22aa038fe9fb24ff37e61 Mon Sep 17 00:00:00 2001 From: "Evgeny V. Generalov" Date: Tue, 6 May 2014 13:19:51 +0600 Subject: [PATCH] Take into account the `python_bin` then `pylint` installed in the system --- pylinter.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pylinter.py b/pylinter.py index 6f3f23e..edb82e9 100755 --- a/pylinter.py +++ b/pylinter.py @@ -17,6 +17,7 @@ import collections import sublime import sublime_plugin +import distutils.spawn #pylint: disable=E1101 @@ -179,14 +180,9 @@ def get_default_pylint_command(cls): python_bin = cls.get_or('python_bin', 'python') pylint_path = cls.get_or('pylint_path', None) if pylint_path is None: - _ = subprocess.Popen("pylint", - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - startupinfo=STARTUPINFO) - speak("Pylint executable found") - return ["pylint"] - else: - return [python_bin, pylint_path] + pylint_path = distutils.spawn.find_executable("pylint") + speak("Pylint executable found at '%s'." % pylint_path) + return [python_bin, pylint_path] except OSError: speak("Pylint executable *not* found") speak("Seaching for lint.py module...")