You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Correct for pypy 3.7
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2021 by Rocky Bernstein
|
# Copyright (c) 2021-2022 by Rocky Bernstein
|
||||||
"""
|
"""
|
||||||
Python PyPy 3.7 decompiler scanner.
|
Python PyPy 3.7 decompiler scanner.
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@ Does some additional massaging of xdis-disassembled instructions to
|
|||||||
make things easier for decompilation.
|
make things easier for decompilation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import decompyle3.scanners.scanner37 as scan
|
import uncompyle6.scanners.scanner37 as scan
|
||||||
|
|
||||||
# bytecode verification, verify(), uses JUMP_OPS from here
|
# bytecode verification, verify(), uses JUMP_OPS from here
|
||||||
from xdis.opcodes import opcode_37pypy as opc # is this right?
|
from xdis.opcodes import opcode_37pypy as opc # is this right?
|
||||||
|
@@ -32,8 +32,9 @@ JUMP_OPs = opc.JUMP_OPS
|
|||||||
|
|
||||||
|
|
||||||
class Scanner37(Scanner37Base):
|
class Scanner37(Scanner37Base):
|
||||||
def __init__(self, show_asm=None):
|
def __init__(self, show_asm=None, is_pypy: bool=False):
|
||||||
Scanner37Base.__init__(self, (3, 7), show_asm)
|
Scanner37Base.__init__(self, (3, 7), show_asm)
|
||||||
|
self.is_pypy = is_pypy
|
||||||
return
|
return
|
||||||
|
|
||||||
pass
|
pass
|
||||||
@@ -56,7 +57,7 @@ class Scanner37(Scanner37Base):
|
|||||||
pass
|
pass
|
||||||
elif t.op == self.opc.BUILD_MAP_UNPACK_WITH_CALL:
|
elif t.op == self.opc.BUILD_MAP_UNPACK_WITH_CALL:
|
||||||
t.kind = "BUILD_MAP_UNPACK_WITH_CALL_%d" % t.attr
|
t.kind = "BUILD_MAP_UNPACK_WITH_CALL_%d" % t.attr
|
||||||
elif t.op == self.opc.BUILD_TUPLE_UNPACK_WITH_CALL:
|
elif not self.is_pypy and t.op == self.opc.BUILD_TUPLE_UNPACK_WITH_CALL:
|
||||||
t.kind = "BUILD_TUPLE_UNPACK_WITH_CALL_%d" % t.attr
|
t.kind = "BUILD_TUPLE_UNPACK_WITH_CALL_%d" % t.attr
|
||||||
pass
|
pass
|
||||||
return tokens, customize
|
return tokens, customize
|
||||||
|
Reference in New Issue
Block a user