Commit 2bf55916 authored by Chris Lamb's avatar Chris Lamb 💬

Skip extra newline in "Output:\n<none>".

parent 9414852a
......@@ -437,16 +437,18 @@ class File(object, metaclass=abc.ABCMeta):
)
except subprocess.CalledProcessError as e:
difference = self.compare_bytes(other, source=source)
if e.output:
output = re.sub(r'^', ' ', e.output, flags=re.MULTILINE)
else:
output = '<none>'
cmd = ' '.join(e.cmd)
if difference is None:
return None
output = '<none>'
if e.output:
output = '\n{}'.format(
re.sub(r'^', ' ', e.output, flags=re.MULTILINE)
)
difference.add_comment(
"Command `%s` exited with %d. Output:\n%s"
% (cmd, e.returncode, output)
"Command `{}` exited with {}. Output: {}".format(
cmd, e.returncode, output
)
)
except RequiredToolNotFound as e:
difference = self.compare_bytes(other, source=source)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment