From b0ca41e19ad0631d82194405d992a7a3b4a834fc Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 3 Jul 2009 20:01:47 -0700 Subject: [PATCH] Only remove a stale pickle file if it exists Signed-off-by: Shawn O. Pearce --- git_config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/git_config.py b/git_config.py index 2655939b..b47bc66f 100644 --- a/git_config.py +++ b/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): """