unicode bug fix try #2...

this time, for sure!
This commit is contained in:
rocky
2017-12-05 14:20:01 -05:00
parent ee3bdbc2ed
commit e3f62e4a1a

View File

@@ -650,6 +650,7 @@ class SourceWalker(GenericASTTraversal, object):
out = out[:-self.pending_newlines] out = out[:-self.pending_newlines]
if (isinstance(out, str) and if (isinstance(out, str) and
not (PYTHON3 or self.FUTURE_UNICODE_LITERALS)): not (PYTHON3 or self.FUTURE_UNICODE_LITERALS)):
from trepan.api import debug; debug()
out = unicode(out, 'utf-8') out = unicode(out, 'utf-8')
self.f.write(out) self.f.write(out)
@@ -854,7 +855,7 @@ class SourceWalker(GenericASTTraversal, object):
# strings are interpreted: # strings are interpreted:
# u'xxx' -> 'xxx' # u'xxx' -> 'xxx'
# xxx' -> b'xxx' # xxx' -> b'xxx'
if isinstance(data, unicode): if not PYTHON3 and isinstance(data, unicode):
try: try:
try: try:
data = str(data) data = str(data)