🐛 make UnicodeWriter to work with python 3

This commit is contained in:
chfw 2017-11-10 17:12:15 +00:00
parent b3e7d83585
commit 60d375b25d
1 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,8 @@ class UnicodeWriter(object):
for s in row])
# Fetch UTF-8 output from the queue ...
data = self.queue.getvalue()
data = data.decode("utf-8")
if compact.PY2:
data = data.decode("utf-8")
# ... and reencode it into the target encoding
data = self.encoder.encode(data)
# write to the target stream