Commit f4994ae8 authored by jochen@chromium.org's avatar jochen@chromium.org

Don't bail out of the cpplint cache is broken.

Instead, try to remove it.

BUG=none
R=ulan@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/117823013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18441 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6ba39190
...@@ -144,8 +144,8 @@ class FileContentsCache(object): ...@@ -144,8 +144,8 @@ class FileContentsCache(object):
try: try:
sums_file = open(self.sums_file_name, 'r') sums_file = open(self.sums_file_name, 'r')
self.sums = pickle.load(sums_file) self.sums = pickle.load(sums_file)
except IOError: except:
# File might not exist, this is OK. # Cannot parse pickle for any reason. Not much we can do about it.
pass pass
finally: finally:
if sums_file: if sums_file:
...@@ -155,6 +155,14 @@ class FileContentsCache(object): ...@@ -155,6 +155,14 @@ class FileContentsCache(object):
try: try:
sums_file = open(self.sums_file_name, 'w') sums_file = open(self.sums_file_name, 'w')
pickle.dump(self.sums, sums_file) pickle.dump(self.sums, sums_file)
except:
# Failed to write pickle. Try to clean-up behind us.
if sums_file:
sums_file.close()
try:
os.unlink(self.sums_file_name)
except:
pass
finally: finally:
sums_file.close() sums_file.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment