[bitbake-devel] [PATCH] bitbake:main.py: Handle RuntimeError exception in list_extension_modules
Paul Eggleton
paul.eggleton at linux.intel.com
Fri Aug 21 08:07:50 UTC 2015
On Friday 21 August 2015 00:51:44 Olof Johansson wrote:
> On 15-08-20 23:00 +0200, Randy Witt wrote:
> > --- a/bitbake/lib/bb/main.py
> > +++ b/bitbake/lib/bb/main.py
> >
> > @@ -60,7 +60,7 @@ def list_extension_modules(pkg, checkattr):
> > continue
> >
> > try:
> > module = __import__(pkg.__name__, fromlist=[modulename])
> >
> > - except (ImportError, SystemExit):
> >
> > + except (ImportError, SystemExit, RuntimeError):
> > # If we can't import it, it's not valid
> > continue
> >
> > module_if = getattr(module, modulename)
>
> Wouldn't it be better to just skip naming the exceptions you want
> to catch in this case? I.e.:
>
> try:
> module = __import__(...
> except:
> continue
>
> "If we can't import it" ...
As a matter of good practice I try to avoid eating all exceptions that way in
case one of them is a genuine error rather than something we want to ignore.
Maybe this is a reasonable exception (heh) though.
FWIW we might consider just reverting my change if it's causing too much
greif.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
More information about the bitbake-devel
mailing list