aboutsummaryrefslogtreecommitdiff
path: root/budget/utils.py
diff options
context:
space:
mode:
authorJocelyn Delalande <jocelyn@crapouillou.net>2017-03-28 21:42:41 +0200
committerJocelyn Delalande <jocelyn@crapouillou.net>2017-03-29 11:21:39 +0200
commitdfe8297faead666068c99533f79aa2e3de295269 (patch)
tree44df6795cb50143c602c616b827da0fc854e4f74 /budget/utils.py
parent1b94f6738a1cfc117e2af78afdafdfeff84aecd0 (diff)
downloadihatemoney-mirror-dfe8297faead666068c99533f79aa2e3de295269.zip
ihatemoney-mirror-dfe8297faead666068c99533f79aa2e3de295269.tar.gz
ihatemoney-mirror-dfe8297faead666068c99533f79aa2e3de295269.tar.bz2
Add Python 3.4 support
Note that py3.4 is the version shipped in current Debian version (Jessie).
Diffstat (limited to 'budget/utils.py')
-rw-r--r--budget/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/budget/utils.py b/budget/utils.py
index 1e887b8..f518049 100644
--- a/budget/utils.py
+++ b/budget/utils.py
@@ -99,7 +99,9 @@ def list_of_dicts2csv(dict_to_convert):
try:
if six.PY3:
csv_file = StringIO()
- csv_data = [dict_to_convert[0].keys()]
+ # using list() for py3.4 compat. Otherwise, writerows() fails
+ # (expecting a sequence getting a view)
+ csv_data = [list(dict_to_convert[0].keys())]
for dic in dict_to_convert:
csv_data.append([dic[h] for h in dict_to_convert[0].keys()])
else: