Ver Fonte

Only remove a stale pickle file if it exists

Signed-off-by: Shawn O. Pearce <sop@google.com>
Shawn O. Pearce há 16 anos atrás
pai
commit
b0ca41e19a
1 ficheiros alterados com 4 adições e 2 exclusões
  1. 4 2
      git_config.py

+ 4 - 2
git_config.py

@@ -262,9 +262,11 @@ class GitConfig(object):
       finally:
         fd.close()
     except IOError:
-      os.remove(self._pickle)
+      if os.path.exists(self._pickle):
+        os.remove(self._pickle)
     except cPickle.PickleError:
-      os.remove(self._pickle)
+      if os.path.exists(self._pickle):
+        os.remove(self._pickle)
 
   def _ReadGit(self):
     """