def _flush(self):
        try:
            pklfd, tempfn = tempfile.mkstemp(suffix='topic', dir=datadir)
            pkl = os.fdopen(pklfd, 'wb')
            try:
                pickle.dump(self.undos, pkl)
                pickle.dump(self.redos, pkl)
                pickle.dump(self.lastTopics, pkl)
                pickle.dump(self.watchingFor332, pkl)
            except Exception as e:
                self.log.warning('Unable to store pickled data: %s', e)
            pkl.close()
            shutil.move(tempfn, filename)
        except (__HOLE__, shutil.Error) as e:
            self.log.warning('File error: %s', e)
dataset/ETHPy150Open ProgVal/Limnoria/plugins/Topic/plugin.py/Topic._flush