Python 2 sometimes need str->uncode in writing?

This commit is contained in:
rocky
2017-06-19 08:02:59 -04:00
parent 5a519ed36a
commit e1bc0c5cd6

View File

@@ -549,7 +549,7 @@ class SourceWalker(GenericASTTraversal, object):
if self.pending_newlines: if self.pending_newlines:
out = out[:-self.pending_newlines] out = out[:-self.pending_newlines]
if isinstance(out, str): if isinstance(out, str) and not PYTHON3:
out = unicode(out, 'utf-8') out = unicode(out, 'utf-8')
self.f.write(out) self.f.write(out)