MCPcopy
hub / github.com/rocky/python-uncompyle6 / maybe_show_asm

Function maybe_show_asm

uncompyle6/show.py:18–32  ·  view source on GitHub ↗

Show the asm based on the showasm flag (or file object), writing to the appropriate stream depending on the type of the flag. :param showasm: Flag which determines whether the ingested code is written to sys.stdout or not. (It is also to pass a file

(showasm, tokens)

Source from the content-addressed store, hash-verified

16
17
18def maybe_show_asm(showasm, tokens):
19 """
20 Show the asm based on the showasm flag (or file object), writing to the
21 appropriate stream depending on the type of the flag.
22
23 :param showasm: Flag which determines whether the ingested code is
24 written to sys.stdout or not. (It is also to pass a file
25 like object, into which the asm will be written).
26 :param tokens: The asm tokens to show.
27 """
28 if showasm:
29 stream = showasm if hasattr(showasm, "write") else sys.stdout
30 for t in tokens:
31 stream.write(str(t))
32 stream.write("\n")
33
34
35def maybe_show_tree(walker, ast):

Callers 3

python_parserFunction · 0.90
code_deparseFunction · 0.90
code_deparse_alignFunction · 0.90

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected