Return the instruction name at code[loc] using opc to look up instruction names. Returns 'got IndexError' if code[loc] is invalid. `code` is instruction bytecode, `loc` is an offset (integer) and `opc` is an opcode module from `xdis`.
(code, loc, opc)
| 2237 | |
| 2238 | |
| 2239 | def op_at_code_loc(code, loc, opc): |
| 2240 | """Return the instruction name at code[loc] using |
| 2241 | opc to look up instruction names. Returns 'got IndexError' |
| 2242 | if code[loc] is invalid. |
| 2243 | |
| 2244 | `code` is instruction bytecode, `loc` is an offset (integer) and |
| 2245 | `opc` is an opcode module from `xdis`. |
| 2246 | """ |
| 2247 | try: |
| 2248 | op = code[loc] |
| 2249 | except IndexError: |
| 2250 | return "got IndexError" |
| 2251 | return opc.opname[op] |
| 2252 | |
| 2253 | |
| 2254 | def deparsed_find(tup, deparsed, code): |