Commit bded7f71 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Only write something when the output string is non-empty.

Otherwise we get useless trailing newlines in our output.
parent 7e110686
...@@ -46,6 +46,7 @@ def write(p_file, p_string): ...@@ -46,6 +46,7 @@ def write(p_file, p_string):
if not p_file.isatty(): if not p_file.isatty():
p_string = escape_ansi(p_string) p_string = escape_ansi(p_string)
if p_string:
p_file.write(p_string + "\n") p_file.write(p_string + "\n")
class CLIApplication(object): class CLIApplication(object):
......
...@@ -9,7 +9,9 @@ class CommandTest(unittest.TestCase): ...@@ -9,7 +9,9 @@ class CommandTest(unittest.TestCase):
self.errors = "" self.errors = ""
def out(self, p_output): def out(self, p_output):
if p_output:
self.output += escape_ansi(p_output + "\n") self.output += escape_ansi(p_output + "\n")
def error(self, p_error): def error(self, p_error):
if p_error:
self.errors += escape_ansi(p_error + "\n") self.errors += escape_ansi(p_error + "\n")
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