Bläddra i källkod

SCons: Fix potential error when pruning cache on CI

This could cause spurious errors on CI when trying to prune the cache,
as for some reason it tries to remove files/paths which do not exist.

That points at a bug in the `cache_progress` logic but at least this
workaround should prevent CI failures.

(cherry picked from commit 825b245f0d3c705f10afc35f01236ba6b0140632)
Rémi Verschelde 4 år sedan
förälder
incheckning
8605d4ec26
1 ändrade filer med 6 tillägg och 3 borttagningar
  1. 6 3
      methods.py

+ 6 - 3
methods.py

@@ -948,9 +948,12 @@ def show_progress(env):
             return total_size
 
     def progress_finish(target, source, env):
-        with open(node_count_data["fname"], "w") as f:
-            f.write("%d\n" % node_count_data["count"])
-        progressor.delete(progressor.file_list())
+        try:
+            with open(node_count_data["fname"], "w") as f:
+                f.write("%d\n" % node_count_data["count"])
+            progressor.delete(progressor.file_list())
+        except Exception:
+            pass
 
     try:
         with open(node_count_data["fname"]) as f: