You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Merge branch 'master' into python-2.4
This commit is contained in:
@@ -363,7 +363,10 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
def write(self, *data):
|
||||
if (len(data) == 0) or (len(data) == 1 and data[0] == ''):
|
||||
return
|
||||
out = ''.join((str(j) for j in data))
|
||||
if not PYTHON3:
|
||||
out = ''.join((unicode(j) for j in data))
|
||||
else:
|
||||
out = ''.join((str(j) for j in data))
|
||||
n = 0
|
||||
for i in out:
|
||||
if i == '\n':
|
||||
@@ -607,6 +610,11 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
else:
|
||||
self.write(repr(data))
|
||||
else:
|
||||
if not PYTHON3:
|
||||
try:
|
||||
repr(data).encode("ascii")
|
||||
except UnicodeEncodeError:
|
||||
self.write('u')
|
||||
self.write(repr(data))
|
||||
# LOAD_CONST is a terminal, so stop processing/recursing early
|
||||
self.prune()
|
||||
|
Reference in New Issue
Block a user