diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2020-09-09 14:56:55 -0400 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2020-09-16 22:50:21 +0000 |
| commit | c18b89e4cabfc28081a7893ccd4cf8956c9a797f (patch) | |
| tree | a660548d8556f3364e27d65478555d98bf9572f3 /python/compatibility.py | |
| parent | 0fa07f755371447b9d733c6f89bb93f1ece5e7e1 (diff) | |
add support to databuffers, cstr helper, and bv.write for bytearrays
Diffstat (limited to 'python/compatibility.py')
| -rw-r--r-- | python/compatibility.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/compatibility.py b/python/compatibility.py index 99411605..ccb185f8 100644 --- a/python/compatibility.py +++ b/python/compatibility.py @@ -83,6 +83,8 @@ def with_metaclass(meta, *bases): def cstr(arg): if isinstance(arg, bytes) or arg is None: return arg + elif isinstance(arg, bytearray): + return bytes(arg) else: try: return arg.encode('charmap') |
