From c18b89e4cabfc28081a7893ccd4cf8956c9a797f Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Wed, 9 Sep 2020 14:56:55 -0400 Subject: add support to databuffers, cstr helper, and bv.write for bytearrays --- python/databuffer.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python/databuffer.py') 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): -- cgit v1.3.1