From cacf326907447ebf31e77acecfb2e59e2e26a2d1 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 22 Oct 2012 13:52:14 +0100 Subject: [PATCH] Skip bug-based processing if BugsV is missing. --- britney.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/britney.py b/britney.py index 7ed4392..fe24525 100755 --- a/britney.py +++ b/britney.py @@ -635,14 +635,18 @@ class Britney(object): bugs = {} filename = os.path.join(basedir, "BugsV") self.__log("Loading RC bugs data from %s" % filename) - for line in open(filename): - l = line.split() - if len(l) != 2: - self.__log("Malformed line found in line %s" % (line), type='W') - continue - pkg = l[0] - bugs.setdefault(pkg, []) - bugs[pkg] += l[1].split(",") + try: + for line in open(filename): + l = line.split() + if len(l) != 2: + self.__log("Malformed line found in line %s" % (line), + type='W') + continue + pkg = l[0] + bugs.setdefault(pkg, []) + bugs[pkg] += l[1].split(",") + except IOError: + self.__log("%s missing; skipping bug-based processing" % filename) return bugs def write_bugs(self, basedir, bugs):