Quick Python 3.4-3.5 compatibility fix

pull/150/head v0.16.24
Bernhard Mueller 7 years ago
parent 0e63d7c429
commit 5116438cf1
  1. 7
      mythril/analysis/callgraph.py

@ -95,11 +95,12 @@ def extract_nodes(statespace, color_map):
code_split = []
for instruction in instructions:
if instruction['opcode'].startswith("PUSH"):
code_split.append(f"{instruction['address']} {instruction['opcode']} {instruction['argument']}")
code_split.append("%d %s %s" % (instruction['address'], instruction['opcode'], instruction['argument']))
# code_split.append("{instruction['address']} {instruction['opcode']} {instruction['argument']}")
elif instruction['opcode'].startswith("JUMPDEST"):
code_split.append(f"{instruction['address']} {instruction['opcode']} {node.function_name}")
code_split.append("%d %s %s" % (instruction['address'], instruction['opcode'], node.function_name))
else:
code_split.append(f"{instruction['address']} {instruction['opcode']}")
code_split.append("%d %s" % (instruction['address'], instruction['opcode']))
truncated_code = '\n'.join(code_split) if (len(code_split) < 7) else '\n'.join(
code_split[:6]) + "\n(click to expand +)"

Loading…
Cancel
Save