]> code.delx.au - offlineimap/commitdiff
Don't crash if LocalStatus file doesn't exist yet
authorJohn Goerzen <jgoerzen@complete.org>
Mon, 10 Mar 2008 01:27:37 +0000 (20:27 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Mon, 10 Mar 2008 01:27:37 +0000 (20:27 -0500)
Closes: #470174
offlineimap/repository/LocalStatus.py

index 048026d4f7476367874cbad59fc259fc941b86bf..12de16cd99ab86a2882ab50aee64928963881c54 100644 (file)
@@ -43,7 +43,10 @@ class LocalStatusRepository(BaseRepository):
         file = open(filename + ".tmp", "wb")
         file.write(offlineimap.folder.LocalStatus.magicline + '\n')
         file.close()
-        os.unlink(filename)
+        try:
+            os.unlink(filename)
+        except:
+            pass
         os.rename(filename + ".tmp", filename)
         
         # Invalidate the cache.