From fe22780d00e420d5c2a09aa6186c88d019569f42 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 13 Sep 2013 12:54:51 +0200 Subject: [PATCH] [REF] account_export_csv - refactor of columns encoding --- account_export_csv/wizard/account_export_csv.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/account_export_csv/wizard/account_export_csv.py b/account_export_csv/wizard/account_export_csv.py index 2bec0832..3e58307e 100644 --- a/account_export_csv/wizard/account_export_csv.py +++ b/account_export_csv/wizard/account_export_csv.py @@ -51,14 +51,7 @@ class AccountUnicodeWriter(object): #we ensure that we do not try to encode none or bool row = (x or u'' for x in row) - encoded_row = [] - for c in row: - if isinstance(c, unicode): - val = c.encode("utf-8") - else: - val = c - - encoded_row.append(val) + encoded_row = (c.encode("utf-8") if isinstance(c, unicode) else c for c in row) self.writer.writerow(encoded_row) # Fetch UTF-8 output from the queue ...