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,7 +46,8 @@ def write(p_file, p_string):
if not p_file.isatty():
p_string = escape_ansi(p_string)
p_file.write(p_string + "\n")
if p_string:
p_file.write(p_string + "\n")
class CLIApplication(object):
def __init__(self):
......
......@@ -9,7 +9,9 @@ class CommandTest(unittest.TestCase):
self.errors = ""
def out(self, p_output):
self.output += escape_ansi(p_output + "\n")
if p_output:
self.output += escape_ansi(p_output + "\n")
def error(self, p_error):
self.errors += escape_ansi(p_error + "\n")
if p_error:
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