Skip to content

Commit

Permalink
Remove WriterFile buffering from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
backtrader committed May 28, 2020
1 parent 71b1781 commit 9154552
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions backtrader/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,9 @@ def start(self):
self.writelineseparator()
self.writeiterable(self.headers, counter='Id')

self.buffer = []

def stop(self):
self.out.write("\n".join(self.buffer) + "\n")
self.buffer = None
if self.close_out:
self.out.close()
self.out = None

def next(self):
if self.p.csv:
Expand Down Expand Up @@ -157,7 +152,7 @@ def writeiterable(self, iterable, func=None, counter=''):
self.writeline(line)

def writeline(self, line):
self.buffer.append(line)
self.out.write(line + '\n')

def writelines(self, lines):
for l in lines:
Expand Down

0 comments on commit 9154552

Please sign in to comment.