Преглед изворни кода

hob: correctly handle an exception

It doesn't matter if we can't remove the temprorary file, for some reason,
so catch the exception and ignore it.

Partially addresses [YOCTO #1468]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Joshua Lock пре 12 година
родитељ
комит
4394e38b03
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      lib/bb/ui/hob.py

+ 5 - 1
lib/bb/ui/hob.py

@@ -495,7 +495,11 @@ class MainWindow (gtk.Window):
         self.back.set_sensitive(True)
         self.cancel.set_sensitive(False)
         for f in self.files_to_clean:
-            os.remove(f)
+            try:
+                os.remove(f)
+            except OSError:
+                pass
+            self.files_to_clean.remove(f)
         self.files_to_clean = []
 
         lbl = "<b>Build completed</b>\n\nClick 'Edit Image' to start another build or 'View Messages' to view the messages output during the build."