mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
Only delete corrupt pickle config files if they exist
os.remove() raises OSError if the file being removed doesn't exist. Check before calling to ensure we don't raise a useless exception on an already deleted file. Change-Id: I44c1c7dd97a47fcab8afb6c18fdf179158b6dab7 Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
ec1df9b7f6
commit
99482ae58a
@ -257,8 +257,10 @@ class GitConfig(object):
|
||||
finally:
|
||||
fd.close()
|
||||
except IOError:
|
||||
if os.path.exists(self._pickle):
|
||||
os.remove(self._pickle)
|
||||
except cPickle.PickleError:
|
||||
if os.path.exists(self._pickle):
|
||||
os.remove(self._pickle)
|
||||
|
||||
def _ReadGit(self):
|
||||
|
Loading…
Reference in New Issue
Block a user