Skip to content

Commit

Permalink
Quick Python 3.4-3.5 compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerberndt committed Apr 27, 2018
1 parent 0e63d7c commit 5116438
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mythril/analysis/callgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 +)"
Expand Down

0 comments on commit 5116438

Please sign in to comment.