def cleanup(self):
    self._final_out = self.out
    self._out.close()
    out_name = self._out.name
    del self._out
    gc.collect()
    if (not file_):
        rmtemp(out_name)
def cleanup(self):
    self._final_out = self.out
    self._out.close()
    out_name = self._out.name
    del self._out
    gc.collect()
    if (not file_):
        rmtemp(out_name)