diff options
| author | Shawn O. Pearce <sop@google.com> | 2009-07-03 20:01:47 -0700 |
|---|---|---|
| committer | Shawn O. Pearce <sop@google.com> | 2009-07-03 20:03:38 -0700 |
| commit | b0ca41e19ad0631d82194405d992a7a3b4a834fc (patch) | |
| tree | 2e8d73572c88d4a87d70469a082fe0a7a98502d4 | |
| parent | 1875ddd47c0bf38e5cc52e1e5875caabce2d8742 (diff) | |
| download | git-repo-b0ca41e19ad0631d82194405d992a7a3b4a834fc.tar.gz | |
Only remove a stale pickle file if it exists
Signed-off-by: Shawn O. Pearce <sop@google.com>
| -rw-r--r-- | git_config.py | 6 |
1 files 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): | |||
| 262 | finally: | 262 | finally: |
| 263 | fd.close() | 263 | fd.close() |
| 264 | except IOError: | 264 | except IOError: |
| 265 | os.remove(self._pickle) | 265 | if os.path.exists(self._pickle): |
| 266 | os.remove(self._pickle) | ||
| 266 | except cPickle.PickleError: | 267 | except cPickle.PickleError: |
| 267 | os.remove(self._pickle) | 268 | if os.path.exists(self._pickle): |
| 269 | os.remove(self._pickle) | ||
| 268 | 270 | ||
| 269 | def _ReadGit(self): | 271 | def _ReadGit(self): |
| 270 | """ | 272 | """ |
