On Wed, Dec 21, 2005 at 03:35:58PM +0000, Jason Stubbs wrote:
> Author: jstubbs
> Date: 2005-12-21 15:35:57 +0000 (Wed, 21 Dec 2005)
> New Revision: 2424
>
> Modified:
> main/trunk/pym/portage.py
> Log:
> Check that cache modules load correctly and fail if they don't.
>
>
> Modified: main/trunk/pym/portage.py
> ===================================================================
> --- main/trunk/pym/portage.py 2005-12-21 15:27:25 UTC (rev 2423)
> +++ main/trunk/pym/portage.py 2005-12-21 15:35:57 UTC (rev 2424)
> @@ -1281,7 +1281,11 @@
>
> def load_best_module(self,property_string):
> best_mod =
> best_from_dict(property_string,self.modules,self.module_priority)
> - return load_mod(best_mod)
> + try:
> + mod = load_mod(best_mod)
> + except:
> + writemsg(red("!!! Failed to import module '%s'\n") %
> best_mod)
> + sys.exit(1)
>
> def lock(self):
> self.locked = 1
Not sure if hiding the exception away (traceback) is a good thing;
wrapping it with purdy output, sure, but swallowing it?
~harring
pgpzwLPhi61Qd.pgp
Description: PGP signature
