diff options
| author | KyleMiles <krm504@nyu.edu> | 2018-07-06 16:03:26 -0400 |
|---|---|---|
| committer | Ryan Snyder <ryan@vector35.com> | 2018-07-10 18:11:11 -0400 |
| commit | 4d62a0dda1d354411060276f44217cc83d6ac18f (patch) | |
| tree | 5d7e4e96d82afdec8800ca48c1497b1926c54186 /python | |
| parent | eeff59a1368c152beac32f9eb0d823c9f0ab4251 (diff) | |
bv.write and bv.insert require byte-strings
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index cdc88fff..c4fddd7c 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -1778,6 +1778,8 @@ class BinaryView(object): >>> bv.read(0,4) 'AAAA' """ + if not isinstance(data, bytes): + raise TypeError("Must be bytes") buf = databuffer.DataBuffer(data) return core.BNWriteViewBuffer(self.handle, addr, buf.handle) @@ -1796,6 +1798,8 @@ class BinaryView(object): >>> bv.read(0,8) 'BBBBAAAA' """ + if not isinstance(data, bytes): + raise TypeError("Must be bytes") buf = databuffer.DataBuffer(data) return core.BNInsertViewBuffer(self.handle, addr, buf.handle) |
