Skip to content

Commit

Permalink
code coverage issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
maet3608 committed Sep 1, 2020
1 parent 875317f commit 1ee761c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nutsflow/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,10 @@ def __init__(self, filepath, cols=None, skipheader=0, flush=False,
:param kwargs kwargs: Keyword arguments for Python's CSV writer.
See https://docs.python.org/2/library/csv.html
"""
if sys.version_info >= (3, 0):
self.csvfile = open(filepath, 'w', encoding=encoding)
else:
self.csvfile = open(filepath, 'w')
open2 = lambda fp: open(fp, 'w')
open3 = lambda fp: open(fp, 'w', encoding=encoding)
is_py3 = sys.version_info >= (3, 0)
self.csvfile = open3(filepath) if is_py3 else open2(filepath)
self.columns = cols if cols is None else as_tuple(cols)
self.flush = flush
self.fmtfunc = fmtfunc
Expand Down

0 comments on commit 1ee761c

Please sign in to comment.