add linesep to output content if file is not sys.stdout (closes #1383)
This commit is contained in:
parent
62b8ca70c6
commit
19ae5d6312
1 changed files with 2 additions and 2 deletions
|
|
@ -107,7 +107,7 @@ class IFormatter(object):
|
|||
def output(self, formatted):
|
||||
if self.outfile != sys.stdout:
|
||||
with open(self.outfile, "a+") as outfile:
|
||||
outfile.write(formatted.encode('utf-8'))
|
||||
outfile.write(formatted.encode('utf-8') + os.linesep)
|
||||
|
||||
else:
|
||||
for line in formatted.split('\n'):
|
||||
|
|
@ -216,7 +216,7 @@ class PrettyFormatter(IFormatter):
|
|||
self.colored(title, 'yellow', 'bold'))
|
||||
|
||||
if desc is not None:
|
||||
result += u'\n\t%s' % self.colored(desc, 'white')
|
||||
result += u'%s\t%s' % (os.linesep, self.colored(desc, 'white'))
|
||||
|
||||
return result
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue