Reviewers: ulan,

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

Instead, try to remove it.

BUG=none
[email protected]
LOG=n

Please review this at https://codereview.chromium.org/117823013/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+10, -2 lines):
  M tools/presubmit.py


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()



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to