def write(self, data): if not self.writeable(): raise IOError, 'cannot write' return m2.bio_write(self.bio, data)
def __init__(self, data=None): BIO.__init__(self) self.bio = m2.bio_new(m2.bio_s_mem()) self._pyfree = 1 if data is not None: m2.bio_write(self.bio, data)