Add case for when the source package isn't found.

This commit is contained in:
Simon Quigley 2017-08-16 14:34:27 -05:00
parent 74504fe81d
commit 777acdee75

View File

@ -21,5 +21,8 @@ with open(filepath, "r") as ins:
for i in range(len(filearray)):
print("Assigning:")
print(filearray[i])
lp.distributions['ubuntu'].getSourcePackage(name=filearray[i]).addBugSubscription(subscriber=lp.people[teamtowrite])
try:
lp.distributions['ubuntu'].getSourcePackage(name=filearray[i]).addBugSubscription(subscriber=lp.people[teamtowrite])
except AttributeError:
print("Source package not found.")
print("Complete")