__init__.py
branchstable
changeset 1954 9b20f3504af8
parent 1741 fe5266f0f88c
child 1977 606923dff11b
equal deleted inserted replaced
1953:8834399f076e 1954:9b20f3504af8
    44 #import threading
    44 #import threading
    45 #threading.settrace(log_thread)
    45 #threading.settrace(log_thread)
    46 
    46 
    47 class Binary(StringIO):
    47 class Binary(StringIO):
    48     """customize StringIO to make sure we don't use unicode"""
    48     """customize StringIO to make sure we don't use unicode"""
    49     def __init__(self, buf= ''):
    49     def __init__(self, buf=''):
    50         assert isinstance(buf, (str, buffer)), \
    50         assert isinstance(buf, (str, buffer)), \
    51                "Binary objects must use raw strings, not %s" % buf.__class__
    51                "Binary objects must use raw strings, not %s" % buf.__class__
    52         StringIO.__init__(self, buf)
    52         StringIO.__init__(self, buf)
    53 
    53 
    54     def write(self, data):
    54     def write(self, data):