summaryrefslogtreecommitdiff
path: root/python/examples/export_svg.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/examples/export_svg.py')
-rwxr-xr-xpython/examples/export_svg.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/python/examples/export_svg.py b/python/examples/export_svg.py
index 8166b27a..62fc1045 100755
--- a/python/examples/export_svg.py
+++ b/python/examples/export_svg.py
@@ -25,10 +25,7 @@ def escape(toescape):
# handle extended unicode
toescape = toescape.encode('ascii', 'xmlcharrefreplace')
# still escape the basics
- if sys.version_info[0] == 3:
- return ''.join(escape_table.get(chr(i), chr(i)) for i in toescape)
- else:
- return ''.join(escape_table.get(i, i) for i in toescape)
+ return ''.join(escape_table.get(chr(i), chr(i)) for i in toescape)
def save_svg(bv, function):
@@ -91,10 +88,7 @@ def instruction_data_flow(function, address):
# TODO: Extract data flow information
length = function.view.get_instruction_length(address)
func_bytes = function.view.read(address, length)
- if sys.version_info[0] == 3:
- hex = func_bytes.hex()
- else:
- hex = func_bytes.encode('hex')
+ hex = func_bytes.hex()
padded = ' '.join([hex[i:i + 2] for i in range(0, len(hex), 2)])
return 'Opcode: {bytes}'.format(bytes=padded)