def cleanup(self): self.m_data = io.BytesIO() self.m_headers = {} self.m_response = TCPResponse() self.m_handle.setopt(pycurl.WRITEFUNCTION, self.m_data.write)