(self, *args)
Close the file objects and save file if a name was given.
Close the file objects and save file if a name was given.
Close the file objects and save file if a name was given .
def __exit__(self, *args):
        """Close the file objects and save file if a name was given."""
        if self.zip is not None:
            self.zip.close()
        if self.mode == 'w' and self.file is not None and self._file_object is not None:
            with open(self.file, 'wb') as f:
                f.write(self._file_object.getvalue())
        if self._file_object is not None:
            self._file_object.close()
def __exit__ ( self , * args ) : if self . zip is not None : self . zip . close ( ) if self . mode == 'w' and self . file is not None and self . _file_object is not None : with open ( self . file , 'wb' ) as f : f . write ( self . _file_object . getvalue ( ) ) if self . _file_object is not None : self . _file_object . close ( )