Ensure package list contains exactly one item in convenience methods

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
bzr-import-20160707
Julien Cristau 13 years ago committed by Adam D. Barratt
parent 111d6b791a
commit eb0498be93

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

Loading…
Cancel
Save