File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1552,7 +1552,7 @@ def first_write(self, v):
15521552 # newlines, and this function needs to write newlines.
15531553 if newline is None :
15541554 open_newline = None
1555- newline = ' \n '
1555+ newline = os . linesep
15561556 else :
15571557 open_newline = newline
15581558
@@ -1618,7 +1618,7 @@ def first_write(self, v):
16181618 raise ValueError ('invalid fmt: %r' % (fmt ,))
16191619
16201620 if len (header ) > 0 :
1621- header = header .replace (' \n ' , ' \n ' + comments )
1621+ header = header .replace (newline , newline + comments )
16221622 fh .write (comments + header + newline )
16231623 if iscomplex_X :
16241624 for row in X :
@@ -1639,7 +1639,7 @@ def first_write(self, v):
16391639 fh .write (v )
16401640
16411641 if len (footer ) > 0 :
1642- footer = footer .replace (' \n ' , ' \n ' + comments )
1642+ footer = footer .replace (newline , newline + comments )
16431643 fh .write (comments + footer + newline )
16441644 finally :
16451645 if own_fh :
You can’t perform that action at this time.
0 commit comments