From ea71a6990ff8f2f6f327a4416374877b0c2720e5 Mon Sep 17 00:00:00 2001 From: lhinds Date: Wed, 26 Jul 2017 10:13:03 +0100 Subject: Implements file except handler for patchsets Simple try / except handler in the event that an edge case occurs and a patchset is not present. Change-Id: Ica5df2f5b37fff98c52f79bd2a8e47ba46890e80 Signed-off-by: lhinds --- anteater/src/patch_scan.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/anteater/src/patch_scan.py b/anteater/src/patch_scan.py index 1deb68f..873c069 100644 --- a/anteater/src/patch_scan.py +++ b/anteater/src/patch_scan.py @@ -55,8 +55,12 @@ def prepare_patchset(project, patchset): licence_ignore = lists.licence_ignore() # Open patch set to get file list - fo = open(patchset, 'r') - lines = fo.readlines() + try: + fo = open(patchset, 'r') + lines = fo.readlines() + except IOError: + logger.error('%s does not exist', patchset) + sys.exit(1) for line in lines: patch_file = line.strip('\n') -- cgit 1.2.3-korg