You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +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_ASSERT
|
||||
|
||||
# Python 3.4+
|
||||
expr ::= LOAD_CLASSDEREF
|
||||
|
||||
# Python3 drops slice0..slice3
|
||||
|
||||
# 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
|
||||
if self.show_asm in ('both', 'before'):
|
||||
# show_asm = 'before'
|
||||
if show_asm in ('both', 'before'):
|
||||
from xdis.bytecode import Bytecode
|
||||
bytecode = Bytecode(co, self.opc)
|
||||
for instr in bytecode.get_instructions(co):
|
||||
|
@@ -344,6 +344,10 @@ TABLE_DIRECT = {
|
||||
'kv2': ( '%c: %c', 1, 2 ),
|
||||
'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
|
||||
#######################
|
||||
@@ -365,9 +369,10 @@ TABLE_DIRECT = {
|
||||
'importmultiple': ( '%|import %c%c\n', 2, 3 ),
|
||||
'import_cont' : ( ', %c', 2 ),
|
||||
|
||||
# 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 3.4+ Additions
|
||||
#######################
|
||||
'LOAD_CLASSDEREF': ( '%{pattr}', ),
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user