opcode_22.py 785 B

1234567891011121314151617181920212223242526272829303132
  1. # (C) Copyright 2017, 2019, 2021, 2023 by Rocky Bernstein
  2. """
  3. CPython 2.2 bytecode opcodes
  4. This is similar to the opcode portion in Python 2.2's dis.py library.
  5. """
  6. import xdis.opcodes.opcode_2x as opcode_2x
  7. from xdis.opcodes.base import (
  8. def_op,
  9. finalize_opcodes,
  10. init_opdata,
  11. update_pj2,
  12. )
  13. from xdis.opcodes.opcode_2x import update_arg_fmt_base2x, opcode_extended_fmt_base2x
  14. version_tuple = (2, 2)
  15. python_implementation = "CPython"
  16. loc = locals()
  17. init_opdata(loc, opcode_2x, version_tuple)
  18. # 2.2 Bytecodes not in 2.3
  19. def_op(loc, "FOR_LOOP", 114)
  20. def_op(loc, "SET_LINENO", 127, 0, 0)
  21. opcode_arg_fmt = update_arg_fmt_base2x.copy()
  22. opcode_extended_fmt = opcode_extended_fmt12 = opcode_extended_fmt_base2x.copy()
  23. update_pj2(globals(), loc)
  24. finalize_opcodes(loc)