Skip to content

Commit

Permalink
Add fobj.close to CsvLazyDictWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
turicas committed Nov 30, 2018
1 parent 04557b0 commit bbb2c57
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rows/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,13 @@ def writerow(self, row):
self.writerow = self.writer.writerow
return self.writerow(row)

def __del__(self):
self.close()

def close(self):
if self._fobj and not self._fobj.closed:
self._fobj.close()


def execute_command(command):
"""Execute a command and return its output"""
Expand Down

0 comments on commit bbb2c57

Please sign in to comment.