|
6 | 6 | import inspect |
7 | 7 | import sys |
8 | 8 | import types |
9 | | - |
10 | 9 | from typing import Callable |
11 | 10 |
|
12 | 11 | from pygments.token import Comment |
13 | | - |
14 | 12 | from xdis import ( |
15 | 13 | IS_PYPY, |
16 | 14 | Bytecode, |
@@ -370,10 +368,11 @@ def null_print(x): |
370 | 368 | hasattr(opc, "opcode_extended_fmt") |
371 | 369 | and opc.opname[op] in opc.opcode_extended_fmt |
372 | 370 | ): |
373 | | - new_repr = f"""{opc.opcode_extended_fmt[opc.opname[op]]( |
| 371 | + result= opc.opcode_extended_fmt[opc.opname[op]]( |
374 | 372 | opc, list(reversed(instructions)) |
375 | | - )}""" |
376 | | - argrepr = new_repr |
| 373 | + ) |
| 374 | + if result is not None: |
| 375 | + argrepr = result[0] |
377 | 376 | pass |
378 | 377 | elif asm_format in ("extended", "extended-bytes"): |
379 | 378 | # Note: instr.arg is also None |
@@ -433,7 +432,7 @@ def section(msg_str): |
433 | 432 | # dis(msg, msg_nocr, errmsg, section, curframe, |
434 | 433 | # start_offset=10, end_offset=20, highlight='dark') |
435 | 434 | print("-" * 40) |
436 | | - for asm_format in ("std", "extended", "bytes", "extended-bytes"): |
| 435 | + for asm_format in ("extended", "bytes", "extended-bytes", "std"): |
437 | 436 | print("Format is", asm_format) |
438 | 437 | dis(msg, msg_nocr, section, errmsg, disassemble, asm_format=asm_format) |
439 | 438 | print("=" * 30) |
|
0 commit comments