pypy37.py 732 B

1234567891011121314151617181920212223242526
  1. # Copyright (c) 2021 by Rocky Bernstein
  2. """
  3. Python PyPy 3.7 decompiler scanner.
  4. Does some additional massaging of xdis-disassembled instructions to
  5. make things easier for decompilation.
  6. """
  7. import decompyle3.scanners.scanner37 as scan
  8. # bytecode verification, verify(), uses JUMP_OPS from here
  9. from xdis.opcodes import opcode_37pypy as opc # is this right?
  10. JUMP_OPs = opc.JUMP_OPS
  11. # We base this off of 3.7
  12. class ScannerPyPy37(scan.Scanner37):
  13. def __init__(self, show_asm):
  14. # There are no differences in initialization between
  15. # pypy 3.7 and 3.7
  16. scan.Scanner37.__init__(self, show_asm, is_pypy=True)
  17. self.version = (3, 7)
  18. self.opc = opc
  19. self.is_pypy = True
  20. return