summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2016-01-29 18:24:16 -0600
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-02-11 10:27:52 -0800
commit620c1e59735a09828f2e326056a2a76474c0ac59 (patch)
treefe2c582e473098da8ab1687e71adfee1d0a07fee /tools
parent521a73ba405002bdffc940c7d3571bcbf8e196e4 (diff)
downloadbuild-620c1e59735a09828f2e326056a2a76474c0ac59.zip
build-620c1e59735a09828f2e326056a2a76474c0ac59.tar.gz
build-620c1e59735a09828f2e326056a2a76474c0ac59.tar.bz2
repopick: Don't crash if change not found
If change is not located, skip it. Resolves the following: Traceback (most recent call last): File "(omitted)/build/tools/repopick.py", line 258, in <module> review = [x for x in reviews if x['number'] == change][0] IndexError: list index out of range Change-Id: I96423ddc809ac1c7994998db4e1929ca813f20ca
Diffstat (limited to 'tools')
-rwxr-xr-xtools/repopick.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/repopick.py b/tools/repopick.py
index 64db7bf..1840a56 100755
--- a/tools/repopick.py
+++ b/tools/repopick.py
@@ -255,7 +255,11 @@ if __name__ == '__main__':
continue
change = int(change)
- review = [x for x in reviews if x['number'] == change][0]
+ review = next((x for x in reviews if x['number'] == change), None)
+ if review is None:
+ print('Change %d not found, skipping' % change)
+ continue
+
mergables.append({
'subject': review['subject'],
'project': review['project'],