diff --git a/git_config.py b/git_config.py index 138470c5..8e3dfb1b 100644 --- a/git_config.py +++ b/git_config.py @@ -257,9 +257,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): """