summaryrefslogtreecommitdiff
path: root/python/databuffer.py
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2020-09-09 14:56:55 -0400
committerKyleMiles <krm504@nyu.edu>2020-09-16 22:50:21 +0000
commitc18b89e4cabfc28081a7893ccd4cf8956c9a797f (patch)
treea660548d8556f3364e27d65478555d98bf9572f3 /python/databuffer.py
parent0fa07f755371447b9d733c6f89bb93f1ece5e7e1 (diff)
add support to databuffers, cstr helper, and bv.write for bytearrays
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):