[bitbake-devel] [PATCH] bitbake:main.py: Handle RuntimeError exception in list_extension_modules

Olof Johansson olof.johansson at axis.com
Thu Aug 20 22:51:44 UTC 2015


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" ...

-- 
olofjn



More information about the bitbake-devel mailing list