Skip to content

Commit 484f004

Browse files
committed
Go over disasm extended format and "make clean"
1 parent 1d68ba7 commit 484f004

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ test-integration-short:
5555

5656
#: Clean up temporary files
5757
clean:
58-
find . | grep -E "\.pyc\|\.pyo" | xargs rm -rvf;
58+
find . | grep -E '\.pyc' | xargs rm -rvf;
59+
find . | grep -E '\.pyo' | xargs rm -rvf;
5960
$(PYTHON) ./setup.py $@
6061

6162
#: Create source (tarball) and binary (egg) distribution

trepan/lib/disassemble.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
import inspect
77
import sys
88
import types
9-
109
from typing import Callable
1110

1211
from pygments.token import Comment
13-
1412
from xdis import (
1513
IS_PYPY,
1614
Bytecode,
@@ -370,10 +368,11 @@ def null_print(x):
370368
hasattr(opc, "opcode_extended_fmt")
371369
and opc.opname[op] in opc.opcode_extended_fmt
372370
):
373-
new_repr = f"""{opc.opcode_extended_fmt[opc.opname[op]](
371+
result= opc.opcode_extended_fmt[opc.opname[op]](
374372
opc, list(reversed(instructions))
375-
)}"""
376-
argrepr = new_repr
373+
)
374+
if result is not None:
375+
argrepr = result[0]
377376
pass
378377
elif asm_format in ("extended", "extended-bytes"):
379378
# Note: instr.arg is also None
@@ -433,7 +432,7 @@ def section(msg_str):
433432
# dis(msg, msg_nocr, errmsg, section, curframe,
434433
# start_offset=10, end_offset=20, highlight='dark')
435434
print("-" * 40)
436-
for asm_format in ("std", "extended", "bytes", "extended-bytes"):
435+
for asm_format in ("extended", "bytes", "extended-bytes", "std"):
437436
print("Format is", asm_format)
438437
dis(msg, msg_nocr, section, errmsg, disassemble, asm_format=asm_format)
439438
print("=" * 30)

0 commit comments

Comments
 (0)