summaryrefslogtreecommitdiff
path: root/python/databuffer.py
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2019-05-15 15:17:57 -0700
committerJordan Wiens <jordan@psifertex.com>2019-05-15 15:17:57 -0700
commit13a793f7ad19f43ff97c058becb76182b0159452 (patch)
treee677419e13f654f337002d5950193a9abbf90a99 /python/databuffer.py
parent392672b07f971cebe3da5de20a24fd8d425c1061 (diff)
first half of the refactor adding getters and setters for init created properties
Diffstat (limited to 'python/databuffer.py')
-rw-r--r--python/databuffer.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/databuffer.py b/python/databuffer.py
index 8644a75e..3d754090 100644
--- a/python/databuffer.py
+++ b/python/databuffer.py
@@ -34,6 +34,8 @@ class DataBuffer(object):
self.handle = core.handle_of_type(handle, core.BNDataBuffer)
elif isinstance(contents, int) or isinstance(contents, long):
self.handle = core.BNCreateDataBuffer(None, contents)
+ elif isinstance(contents, str):
+ self.handle = core.BNCreateDataBuffer(contents.encode(), len(contents.encode()))
elif isinstance(contents, DataBuffer):
self.handle = core.BNDuplicateDataBuffer(contents.handle)
else: