pypy27.py 901 B

1234567891011121314151617181920212223242526
  1. # Copyright (c) 2016-2017, 2021 by Rocky Bernstein
  2. """
  3. Python PyPy 2.7 bytecode scanner/deparser
  4. This overlaps Python's 2.7's dis module, but it can be run from
  5. Python 3 and other versions of Python. Also, we save token
  6. information for later use in deparsing.
  7. """
  8. import uncompyle6.scanners.scanner27 as scan
  9. # bytecode verification, verify(), uses JUMP_OPs from here
  10. from xdis.opcodes import opcode_27pypy
  11. JUMP_OPS = opcode_27pypy.JUMP_OPS
  12. # We base this off of 2.6 instead of the other way around
  13. # because we cleaned things up this way.
  14. # The history is that 2.7 support is the cleanest,
  15. # then from that we got 2.6 and so on.
  16. class ScannerPyPy27(scan.Scanner27):
  17. def __init__(self, show_asm):
  18. # There are no differences in initialization between
  19. # pypy 2.7 and 2.7
  20. scan.Scanner27.__init__(self, show_asm, is_pypy=True)
  21. self.version = (2, 7)
  22. return