From 7795ab1e114efa08bd88e6e8666f6886e240a5d1 Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Mon, 5 Feb 2018 12:30:30 +0100 Subject: [PATCH] constants were moved in SL4 --- linter.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/linter.py b/linter.py index 2fbaef1..002ab3c 100644 --- a/linter.py +++ b/linter.py @@ -13,7 +13,16 @@ from contextlib import contextmanager from functools import partial -from SublimeLinter.lint import PythonLinter, highlight, persist, util +from SublimeLinter.lint import PythonLinter, persist, util + + +import SublimeLinter +if getattr(SublimeLinter.lint, 'VERSION', 3) > 3: + from SublimeLinter.lint import const + WARNING = const.WARNING +else: + from SublimeLinter.lint import highlight + WARNING = highlight.WARNING class Pydocstyle(PythonLinter): @@ -26,7 +35,7 @@ class Pydocstyle(PythonLinter): version_requirement = '>= 0.3.0' regex = r'^.+?:(?P\d+).*:\r?\n\s*(?PD\d{3}):\s(?P.+)$' multiline = True - default_type = highlight.WARNING + default_type = WARNING error_stream = util.STREAM_BOTH line_col_base = (1, 0) # uses one-based line and zero-based column numbers tempfile_suffix = 'py'