summaryrefslogtreecommitdiff
path: root/python/examples/bin_info.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2020-06-16 19:04:07 -0400
committerRusty Wagner <rusty@vector35.com>2020-06-16 19:04:07 -0400
commit8ef7fc54f93a041725dbd4d7bf2a8be159e3ee6f (patch)
tree7afc6d4344c63f6799bc9feeb1212bfecf2dfd1b /python/examples/bin_info.py
parent75588da11bc29b00cac46c494ea389ac87b49778 (diff)
Use Python 3 for bininfo test
Diffstat (limited to 'python/examples/bin_info.py')
-rw-r--r--python/examples/bin_info.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/examples/bin_info.py b/python/examples/bin_info.py
index 6b87eaf0..f74b9466 100644
--- a/python/examples/bin_info.py
+++ b/python/examples/bin_info.py
@@ -63,6 +63,10 @@ def get_bininfo(bv):
start = bv.strings[i].start
length = bv.strings[i].length
string = bv.read(start, length)
+ try:
+ string = string.decode('utf8')
+ except UnicodeDecodeError:
+ pass
contents += "| 0x%x |%d | %s |\n" % (start, length, string)
return contents