summaryrefslogtreecommitdiff
path: root/python/platform.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2020-06-12 16:27:36 -0400
committerPeter LaFosse <peter@vector35.com>2020-06-23 09:02:48 -0400
commite0fbcc712f8ca31914d2f1e04b7f8b16eff44d66 (patch)
tree1c79e6e76f4d0bdf6dfc09c3cd3036dbf96c56f2 /python/platform.py
parent4ffa5187aa0c9589dffac5bf00f3a7dd423578e8 (diff)
Add BinaryView.parse_types_from_string to the python API and update how the underlying BNParseTypesString works
Diffstat (limited to 'python/platform.py')
-rw-r--r--python/platform.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/platform.py b/python/platform.py
index 5031d2d6..8d7d1d99 100644
--- a/python/platform.py
+++ b/python/platform.py
@@ -411,7 +411,7 @@ class Platform(with_metaclass(_PlatformMetaClass, object)):
errors = ctypes.c_char_p()
result = core.BNParseTypesFromSource(self.handle, source, filename, parse, errors, dir_buf,
len(include_dirs), auto_type_source)
- error_str = errors.value
+ error_str = errors.value.decode("utf-8")
core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte)))
if not result:
raise SyntaxError(error_str)
@@ -460,7 +460,7 @@ class Platform(with_metaclass(_PlatformMetaClass, object)):
errors = ctypes.c_char_p()
result = core.BNParseTypesFromSourceFile(self.handle, filename, parse, errors, dir_buf,
len(include_dirs), auto_type_source)
- error_str = errors.value
+ error_str = errors.value.decode("utf-8")
core.BNFreeString(ctypes.cast(errors, ctypes.POINTER(ctypes.c_byte)))
if not result:
raise SyntaxError(error_str)