Ensure package list contains exactly one item in convenience methods

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
debian
Julien Cristau 13 years ago committed by Adam D. Barratt
parent 157b4ee947
commit b76d9e189a

@ -88,6 +88,7 @@ class Hint:
@property @property
def package(self): def package(self):
if self.packages: if self.packages:
assert len(self.packages) == 1, self.packages
return self.packages[0].package return self.packages[0].package
else: else:
return None return None
@ -95,6 +96,7 @@ class Hint:
@property @property
def version(self): def version(self):
if self.packages: if self.packages:
assert len(self.packages) == 1, self.packages
return self.packages[0].version return self.packages[0].version
else: else:
return None return None

Loading…
Cancel
Save