Duck type, so that simple strings are an accepted output
@@ -703,7 +703,7 @@ class Linter(metaclass=LinterMeta):
# `cmd = None` is a special API signal, that the plugin author
# implemented its own `run`
if self.cmd is None:
- output = self.run(None, code)
+ output = self.run(None, code) # type: str!
else:
cmd = self.get_cmd()
if not cmd: # We couldn't find an executable
@@ -722,7 +722,11 @@ class Linter(metaclass=LinterMeta):
return self.parse_output(output, virtual_view)
def parse_output(self, proc, virtual_view):
+ try:
output, stderr = proc.stdout, proc.stderr
+ except AttributeError:
+ output = proc
+ else:
# Try to handle `on_stderr`, but only for STREAM_BOTH linters
if (
output is not None and
