Commits

Anonymous committed f218a41

Not raising IOError when memorydb file has been removed

  • Participants
  • Parent commits d190167

Comments (0)

Files changed (1)

File rope/base/oi/memorydb.py

 
     def sync(self):
         if self.persist:
-            output = open(self._get_persisted_file().real_path, 'wb')
-            pickle.dump(self._files, output)
-            output.close()
+            persisted = self._get_persisted_file()
+            if persisted.exists():
+                output = open(persisted.real_path, 'wb')
+                pickle.dump(self._files, output)
+                output.close()
 
 
 class FileInfo(objectdb.FileInfo):