From dfe8297faead666068c99533f79aa2e3de295269 Mon Sep 17 00:00:00 2001 From: Jocelyn Delalande Date: Tue, 28 Mar 2017 21:42:41 +0200 Subject: Add Python 3.4 support Note that py3.4 is the version shipped in current Debian version (Jessie). --- budget/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'budget') 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: -- cgit v1.1