Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: tools/presubmit.py

Issue 117823013: Don't bail out of the cpplint cache is broken. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/presubmit.py
diff --git a/tools/presubmit.py b/tools/presubmit.py
index 56eac8ecea47aa9c4501a21ee7506df55911af71..88f1459d739f190ef62549a27c1545b83ebc595c 100755
--- a/tools/presubmit.py
+++ b/tools/presubmit.py
@@ -144,8 +144,8 @@ class FileContentsCache(object):
try:
sums_file = open(self.sums_file_name, 'r')
self.sums = pickle.load(sums_file)
- except IOError:
- # File might not exist, this is OK.
+ except:
+ # Cannot parse pickle for any reason. Not much we can do about it.
pass
finally:
if sums_file:
@@ -155,6 +155,14 @@ class FileContentsCache(object):
try:
sums_file = open(self.sums_file_name, 'w')
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:
sums_file.close()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698