From b76d9e189aa0f215ce645020268ad31cfea321a2 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 14 Nov 2011 18:29:43 +0000 Subject: [PATCH] Ensure package list contains exactly one item in convenience methods Signed-off-by: Adam D. Barratt --- hints.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hints.py b/hints.py index 2f0c490..dfc4539 100644 --- a/hints.py +++ b/hints.py @@ -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