From 1aca962af153d6437937e3e687740d2c1c12657d Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 4 Aug 2009 15:09:27 -0700 Subject: [PATCH] allow for malformed imagesizes.txt Some builds have blank values for max image sizes; ignore these lines. --- tools/releasetools/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 42a774271e..5e5b856155 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -52,8 +52,10 @@ def LoadMaxSizes(): OPTIONS.max_image_size = {} try: for line in open(os.path.join(OPTIONS.input_tmp, "META", "imagesizes.txt")): - image, size = line.split() - size = int(size) + pieces = line.split() + if len(pieces) != 2: continue + image = pieces[0] + size = int(pieces[1]) OPTIONS.max_image_size[image + ".img"] = size except IOError, e: if e.errno == errno.ENOENT: