From: Torsten Werner Date: Wed, 10 Aug 2011 07:08:39 +0000 (+0200) Subject: get_suite_architectures() can return None X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=388b17e63a6b288d8131dcd430f778c4fe089493;p=dak.git get_suite_architectures() can return None Signed-off-by: Torsten Werner --- diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 6d954c88..85052f63 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -3005,11 +3005,11 @@ __all__.append('get_suite') ################################################################################ -# TODO: should be removed because the implementation is too trivial @session_wrapper def get_suite_architectures(suite, skipsrc=False, skipall=False, session=None): """ - Returns list of Architecture objects for given C{suite} name + Returns list of Architecture objects for given C{suite} name or None if + suite does not exist @type suite: str @param suite: Suite name to search for @@ -3030,7 +3030,10 @@ def get_suite_architectures(suite, skipsrc=False, skipall=False, session=None): @return: list of Architecture objects for the given name (may be empty) """ - return get_suite(suite, session).get_architectures(skipsrc, skipall) + try: + return get_suite(suite, session).get_architectures(skipsrc, skipall) + except AttributeError: + return None __all__.append('get_suite_architectures')