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/compatibility.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python/compatibility.py') 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') -- cgit v1.3.1