equal
deleted
inserted
replaced
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): |