diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2022-05-14 02:22:35 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2022-05-14 02:22:35 -0400 |
| commit | 3c1c40158da1e2af9aced53056ad4c3aaafc0913 (patch) | |
| tree | 3a2029e068d6f10e65fdad99167e4a406946d1fa /python/examples/export_svg.py | |
| parent | 5926698ea5013fab44d95d8a0f046888398565de (diff) | |
remove more vestigal py2 code
Diffstat (limited to 'python/examples/export_svg.py')
| -rwxr-xr-x | python/examples/export_svg.py | 10 |
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) |
