From 32593bfabaffa866abd335d078e8f7272c0dc3af Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Fri, 22 Aug 2008 21:38:27 +0000 Subject: [PATCH] Fix find_packages and find_installed_packages to print a warning instead of a traceback when an InvalidAtom exception occurs. (Bug #234358) svn path=/; revision=507 --- trunk/ChangeLog | 5 +++++ trunk/src/gentoolkit/helpers.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 17124b6..8f1956c 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,8 @@ +2008-08-22: Paul Varner + * gentoolkit: Fix find_packages and find_installed_packages to print + a warning instead of a traceback when an InvalidAtom exception occurs. + (Bug #234358) + 2008-08-22: Paul Varner * equery: Fix equery belongs to strip multiple slashes from path names. (Bug #234584) diff --git a/trunk/src/gentoolkit/helpers.py b/trunk/src/gentoolkit/helpers.py index 6dba7db..bf2b1b1 100644 --- a/trunk/src/gentoolkit/helpers.py +++ b/trunk/src/gentoolkit/helpers.py @@ -10,6 +10,7 @@ import portage from gentoolkit import * from package import * +from pprinter import print_warn try: from portage.util import unique_array except ImportError: @@ -37,6 +38,9 @@ def find_packages(search_key, masked=False): t += portage.db["/"]["vartree"].dbapi.match(cp) else: raise ValueError(e) + except portage_exception.InvalidAtom, e: + print_warn("Invalid Atom: '%s'" % str(e)) + return [] # Make the list of packages unique t = unique_array(t) t.sort() @@ -54,6 +58,9 @@ def find_installed_packages(search_key, masked=False): t += portage.db["/"]["vartree"].dbapi.match(cp) else: raise ValueError(e) + except portage_exception.InvalidAtom, e: + print_warn("Invalid Atom: '%s'" % str(e)) + return [] return [Package(x) for x in t] def find_best_match(search_key): -- 2.26.2