diff --git a/pyls/plugins/pyflakes_lint.py b/pyls/plugins/pyflakes_lint.py index d1f99985..ce890323 100644 --- a/pyls/plugins/pyflakes_lint.py +++ b/pyls/plugins/pyflakes_lint.py @@ -35,6 +35,10 @@ def unexpectedError(self, filename, msg): # pragma: no cover pass def syntaxError(self, _filename, msg, lineno, offset, text): + # We've seen that lineno and offset can sometimes be None + lineno = lineno or 1 + offset = offset or 0 + err_range = { 'start': {'line': lineno - 1, 'character': offset}, 'end': {'line': lineno - 1, 'character': offset + len(text)},