aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/utils/io.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/utils/io.py b/bin/utils/io.py
index 2cd3667..04baa6a 100644
--- a/bin/utils/io.py
+++ b/bin/utils/io.py
@@ -20,7 +20,15 @@ class FileWriterCSV:
def __init__(self, fd=sys.stdout):
self._writer = csv.writer(fd, lineterminator='\n')
+ @staticmethod
+ def _convert_row_old_python(row):
+ if isinstance(row, list) or isinstance(row, tuple):
+ return row
+ return list(row)
+
def write_row(self, row):
+ if sys.version_info < (3, 5):
+ row = self._convert_row_old_python(row)
self._writer.writerow(row)
@contextmanager