1
Description: Call pylint3 instead of pylint on Python 3
2
Author: Benjamin Drung <benjamin.drung@profitbricks.com>
3
Forwarded: yes, https://bitbucket.org/spyder-ide/spyderlib/pull-request/91
5
--- a/spyderplugins/widgets/pylintgui.py
6
+++ b/spyderplugins/widgets/pylintgui.py
7
@@ -36,11 +36,15 @@ from spyderlib.widgets.onecolumntree imp
8
from spyderlib.widgets.texteditor import TextEditor
9
from spyderlib.widgets.comboboxes import (PythonModulesComboBox,
11
-from spyderlib.py3compat import to_text_string, getcwd, pickle
12
+from spyderlib.py3compat import PY3, to_text_string, getcwd, pickle
13
_ = get_translation("p_pylint", dirname="spyderplugins")
16
-PYLINT_PATH = programs.find_program('pylint')
18
+if PY3 and programs.find_program('pylint3'):
21
+PYLINT_PATH = programs.find_program(PYLINT)
24
def get_pylint_version():
25
@@ -48,13 +52,13 @@ def get_pylint_version():
27
if PYLINT_PATH is None:
29
- process = subprocess.Popen(['pylint', '--version'],
30
+ process = subprocess.Popen([PYLINT, '--version'],
31
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
32
cwd=osp.dirname(PYLINT_PATH),
33
shell=True if os.name == 'nt' else False)
34
lines = to_unicode_from_fs(process.stdout.read()).splitlines()
36
- match = re.match('(pylint|pylint-script.py) ([0-9\.]*)', lines[0])
37
+ match = re.match('(pylint3?|pylint-script.py) ([0-9\.]*)', lines[0])
39
return match.groups()[1]