From 3c1c40158da1e2af9aced53056ad4c3aaafc0913 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Sat, 14 May 2022 02:22:35 -0400 Subject: remove more vestigal py2 code --- python/examples/export_svg.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'python/examples/export_svg.py') 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) -- cgit v1.3.1