summaryrefslogtreecommitdiff
path: root/python/databuffer.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/databuffer.py')
-rw-r--r--python/databuffer.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/databuffer.py b/python/databuffer.py
index d05ad1f5..26347101 100644
--- a/python/databuffer.py
+++ b/python/databuffer.py
@@ -39,6 +39,9 @@ class DataBuffer(object):
else:
if bytes != str and isinstance(contents, str):
contents = contents.encode('charmap')
+ else:
+ if isinstance(contents, bytearray):
+ contents = bytes(contents)
self.handle = core.BNCreateDataBuffer(contents, len(contents))
def __del__(self):