commit | b0ca41e19ad0631d82194405d992a7a3b4a834fc | [log] [tgz] |
---|---|---|
author | Shawn O. Pearce <sop@google.com> | Fri Jul 03 20:01:47 2009 -0700 |
committer | Shawn O. Pearce <sop@google.com> | Fri Jul 03 20:03:38 2009 -0700 |
tree | 2e8d73572c88d4a87d70469a082fe0a7a98502d4 | |
parent | 1875ddd47c0bf38e5cc52e1e5875caabce2d8742 [diff] |
Only remove a stale pickle file if it exists Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/git_config.py b/git_config.py index 2655939..b47bc66 100644 --- a/git_config.py +++ b/git_config.py
@@ -262,9 +262,11 @@ 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): """