From 3c8f72607eca776f44edd87d729ae8ec66120027 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 16 Dec 2013 23:03:34 +0100 Subject: [PATCH] Avoid exploding when reading broken hints If hint.check() fails, just ignore the hint instead of killing britney. Signed-off-by: Julien Cristau --- hints.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hints.py b/hints.py index b54584c..7b43cdb 100644 --- a/hints.py +++ b/hints.py @@ -33,7 +33,10 @@ class HintCollection(object): ] def add_hint(self, hint, user): - self._hints.append(Hint(hint, user)) + try: + self._hints.append(Hint(hint, user)) + except AssertionError: + print "Ignoring broken hint %r from %s" % (hint, user) class Hint(object): NO_VERSION = [ 'block', 'block-all', 'block-udeb' ]