diff -r 512ba8f37bd4 -r 3231fd2fa7a5 __init__.py --- a/__init__.py Thu Mar 12 14:21:36 2015 +0100 +++ b/__init__.py Wed Mar 18 14:41:47 2015 +0100 @@ -69,12 +69,12 @@ class Binary(StringIO): """customize StringIO to make sure we don't use unicode""" def __init__(self, buf=''): - assert isinstance(buf, (str, buffer)), \ + assert isinstance(buf, (str, buffer, bytearray)), \ "Binary objects must use raw strings, not %s" % buf.__class__ StringIO.__init__(self, buf) def write(self, data): - assert isinstance(data, (str, buffer)), \ + assert isinstance(data, (str, buffer, bytearray)), \ "Binary objects must use raw strings, not %s" % data.__class__ StringIO.write(self, data)