diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2019-01-22 00:50:03 -0500 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2019-01-22 00:50:03 -0500 |
| commit | 245f503ad9ead9257f7d4b8932a86fa9064b5b59 (patch) | |
| tree | bb3184b495d71352daf4117b5c9d019939a54674 /python | |
| parent | 4d24afdc1ccf5690b9f0338b0d9687b88ed9801d (diff) | |
fixes #1253 by handling bytes and strings for find_next_data
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index 2386ff47..951b3f09 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -1963,8 +1963,12 @@ class BinaryView(object): 'AAAA' """ if not isinstance(data, bytes): - raise TypeError("Must be bytes") - buf = databuffer.DataBuffer(data) + if isinstance(data, str): + buf = databuffer.DataBuffer(data.encode()) + else: + raise TypeError("Must be bytes or str") + else: + buf = databuffer.DataBuffer(data) return core.BNWriteViewBuffer(self.handle, addr, buf.handle) def insert(self, addr, data): |
