File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,11 @@ def dump_file(self, f):
147147 warnings .warn ("It is recommended to write UTF-8 with BOM"
148148 " using the '%s' encoding" % self .PREFERRED_ENCODING .name )
149149
150+ first = True
150151 for section in self .sections .values ():
151- f .write ("\n " .join (section .dump ()))
152- f .write ("\n \n " )
152+ if not first :
153+ f .write ("\n " )
154+ for line in section .dump ():
155+ f .write (line )
156+ f .write ("\n " )
157+ first = False
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def test_parse_dump(self):
2323 out = StringIO ()
2424 doc .dump_file (out )
2525
26- assert out .getvalue (). strip () == contents . strip ()
26+ assert out .getvalue () == contents
2727
2828 def test_parse_encoding (self ):
2929 with self .test_ass .open ("r" , encoding = 'utf_8' ) as f :
You can’t perform that action at this time.
0 commit comments