You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
For Python 3: add LOAD_CLASSDEREF op
This commit is contained in:
@@ -344,6 +344,10 @@ class Python3Parser(PythonParser):
|
|||||||
'''
|
'''
|
||||||
expr ::= LOAD_CLASSNAME
|
expr ::= LOAD_CLASSNAME
|
||||||
expr ::= LOAD_ASSERT
|
expr ::= LOAD_ASSERT
|
||||||
|
|
||||||
|
# Python 3.4+
|
||||||
|
expr ::= LOAD_CLASSDEREF
|
||||||
|
|
||||||
# Python3 drops slice0..slice3
|
# Python3 drops slice0..slice3
|
||||||
|
|
||||||
# Python 3.3+ adds yield from
|
# Python 3.3+ adds yield from
|
||||||
|
@@ -50,7 +50,8 @@ class Scanner2(scan.Scanner):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
show_asm = self.show_asm if not show_asm else show_asm
|
show_asm = self.show_asm if not show_asm else show_asm
|
||||||
if self.show_asm in ('both', 'before'):
|
# show_asm = 'before'
|
||||||
|
if show_asm in ('both', 'before'):
|
||||||
from xdis.bytecode import Bytecode
|
from xdis.bytecode import Bytecode
|
||||||
bytecode = Bytecode(co, self.opc)
|
bytecode = Bytecode(co, self.opc)
|
||||||
for instr in bytecode.get_instructions(co):
|
for instr in bytecode.get_instructions(co):
|
||||||
|
@@ -344,6 +344,10 @@ TABLE_DIRECT = {
|
|||||||
'kv2': ( '%c: %c', 1, 2 ),
|
'kv2': ( '%c: %c', 1, 2 ),
|
||||||
'mapexpr': ( '{%[1]C}', (0, maxint, ', ') ),
|
'mapexpr': ( '{%[1]C}', (0, maxint, ', ') ),
|
||||||
|
|
||||||
|
# CE - Fixes for tuples
|
||||||
|
'assign2': ( '%|%c, %c = %c, %c\n', 3, 4, 0, 1 ),
|
||||||
|
'assign3': ( '%|%c, %c, %c = %c, %c, %c\n', 5, 6, 7, 0, 1, 2 ),
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# Python 2.3 Additions
|
# Python 2.3 Additions
|
||||||
#######################
|
#######################
|
||||||
@@ -365,9 +369,10 @@ TABLE_DIRECT = {
|
|||||||
'importmultiple': ( '%|import %c%c\n', 2, 3 ),
|
'importmultiple': ( '%|import %c%c\n', 2, 3 ),
|
||||||
'import_cont' : ( ', %c', 2 ),
|
'import_cont' : ( ', %c', 2 ),
|
||||||
|
|
||||||
# CE - Fixes for tuples
|
########################
|
||||||
'assign2': ( '%|%c, %c = %c, %c\n', 3, 4, 0, 1 ),
|
# Python 3.4+ Additions
|
||||||
'assign3': ( '%|%c, %c, %c = %c, %c, %c\n', 5, 6, 7, 0, 1, 2 ),
|
#######################
|
||||||
|
'LOAD_CLASSDEREF': ( '%{pattr}', ),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user