You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Fix improper 3.0 class handling...
... is like 3.1 not 2.7
This commit is contained in:
BIN
test/bytecode_3.0/10_classdec.pyc
Normal file
BIN
test/bytecode_3.0/10_classdec.pyc
Normal file
Binary file not shown.
Binary file not shown.
@@ -25,3 +25,7 @@ class MyClass(object):
|
||||
pass
|
||||
|
||||
x = MyClass()
|
||||
|
||||
# Try class without parens
|
||||
class Feature:
|
||||
pass
|
||||
|
@@ -32,6 +32,8 @@ def customize_for_version3(self, version):
|
||||
'store_locals': ( '%|# inspect.currentframe().f_locals = __locals__\n', ),
|
||||
})
|
||||
|
||||
assert version >= 3.0
|
||||
|
||||
if version >= 3.3:
|
||||
def n_yield_from(node):
|
||||
self.write('yield from')
|
||||
|
@@ -1234,7 +1234,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
# -----------
|
||||
# * subclass_code - the code for the subclass body
|
||||
subclass_info = None
|
||||
if self.version > 3.0:
|
||||
if self.version >= 3.0:
|
||||
if node == 'classdefdeco2':
|
||||
if self.version >= 3.6:
|
||||
class_name = node[1][1].pattr
|
||||
@@ -1349,7 +1349,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
self.currentclass = str(class_name)
|
||||
self.write(self.indent, 'class ', self.currentclass)
|
||||
|
||||
if self.version > 3.0:
|
||||
if self.version >= 3.0:
|
||||
self.print_super_classes3(subclass_info)
|
||||
else:
|
||||
self.print_super_classes(build_list)
|
||||
|
Reference in New Issue
Block a user