~gilgamezh/encuentro/virtualenvizar

« back to all changes in this revision

Viewing changes to encuentro/data.py

  • Committer: Facundo Batista
  • Date: 2014-03-23 13:53:53 UTC
  • mfrom: (197.1.1 grabar)
  • Revision ID: facundo@taniquetil.com.ar-20140323135353-qwy18ie2s0r9vled
Merged branch to enhance the way each pickle is saved.

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
    def save(self):
268
268
        """Save to disk."""
269
269
        to_save = (self.last_programs_version, self.data)
270
 
        with open(self.filename, 'wb') as fh:
 
270
        temp = self.filename + ".tmp"
 
271
        with open(temp, 'wb') as fh:
271
272
            pickle.dump(to_save, fh)
 
273
        os.rename(temp, self.filename)