__init__.py
changeset 10272 3231fd2fa7a5
parent 10045 0a49d61c8cca
parent 10266 813e30041a93
child 10602 4845012cfc8e
--- 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)