Don't assume bugs are in order

This commit is contained in:
Marco Castelluccio 2018-06-18 17:49:21 +01:00
Родитель a45fc4ba6f
Коммит 392c8dd721
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -26,12 +26,14 @@ def get_bugs(bug_ids):
with open('data/' + str(bug_id) + '.json', 'r') as f: with open('data/' + str(bug_id) + '.json', 'r') as f:
bugs[bug_id] = json.load(f) bugs[bug_id] = json.load(f)
except IOError: except IOError:
break continue
bug_ids = [bug_id for bug_id in bug_ids if bug_id not in bugs] bug_ids = [bug_id for bug_id in bug_ids if bug_id not in bugs]
print('Loaded ' + str(len(bugs)) + ' bugs.') print('Loaded ' + str(len(bugs)) + ' bugs.')
print('To download ' + str(len(bug_ids))+ ' bugs.')
def bughandler(bug): def bughandler(bug):
bug_id = int(bug['id']) bug_id = int(bug['id'])