Ignore non-existing unnecessary files in RawprogramUnsparseHandler

This commit is contained in:
Jakob Lell 2021-10-07 17:45:32 +02:00
parent 5f782ad559
commit 9fb21b88c6
1 changed files with 4 additions and 1 deletions

View File

@ -588,7 +588,10 @@ class RawprogramUnsparseHandler(FileHandler):
elif label.startswith("custom") or label.startswith("userdata"):
filename = program_tag.attrib["filename"]
abs_fn = os.path.join(image_base_dir, filename.encode())
self.extra_ignored_size += os.stat(abs_fn).st_size
try:
self.extra_ignored_size += os.stat(abs_fn).st_size
except FileNotFoundError:
pass
else:
# Just to make sure we aren't missing a vendor partition here
assert 'vendor' not in label.lower(), "Found unexpected program label containing 'vendor' in %r" % program_tag.attrib["label"]