__init__.py
changeset 10266 813e30041a93
parent 9984 793377697c81
child 10272 3231fd2fa7a5
--- a/__init__.py	Fri Mar 13 14:47:35 2015 +0100
+++ b/__init__.py	Tue Mar 17 09:19:06 2015 +0100
@@ -71,12 +71,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)