You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
unicode bug fix try #2...
this time, for sure!
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user