You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Python 3 class deparsing. stop earlier in uncompyle6 on a syntax error.
This commit is contained in:
@@ -1118,22 +1118,20 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
|
||||
def print_super_classes3(self, node):
|
||||
|
||||
# FIXME: wrap superclasses onto a node
|
||||
# as a custom rule
|
||||
n = len(node)-1
|
||||
assert node[n].type.startswith('CALL_FUNCTION')
|
||||
|
||||
for i in range(n-1, 0, -1):
|
||||
for i in range(n-2, 0, -1):
|
||||
if not node[i].type in ['expr', 'LOAD_CLASSNAME']:
|
||||
break
|
||||
pass
|
||||
|
||||
if i == n-1:
|
||||
if i == n-2:
|
||||
return
|
||||
self.write('(')
|
||||
line_separator = ', '
|
||||
sep = ''
|
||||
i += 1
|
||||
i += 2
|
||||
while i < n:
|
||||
value = self.traverse(node[i])
|
||||
i += 1
|
||||
|
Reference in New Issue
Block a user