From: Paul Eggleton Date: Mon, 20 Mar 2017 04:16:20 +0000 (+1300) Subject: devtool: tidy up handling of parse failures X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~21962 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18304036e1b513fd12c049dbf549ba75c503ed84;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git devtool: tidy up handling of parse failures Since the tinfoil2 refactoring, if an error occurred during parsing, we were showing a traceback and not correctly exiting (since we weren't calling shutdown()). Fix both of these issues. Signed-off-by: Paul Eggleton Signed-off-by: Ross Burton --- diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 91111e11092..8c385beb896 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -114,8 +114,15 @@ def setup_tinfoil(config_only=False, basepath=None, tracking=False): import bb.tinfoil tinfoil = bb.tinfoil.Tinfoil(tracking=tracking) - tinfoil.prepare(config_only) - tinfoil.logger.setLevel(logger.getEffectiveLevel()) + try: + tinfoil.prepare(config_only) + tinfoil.logger.setLevel(logger.getEffectiveLevel()) + except bb.tinfoil.TinfoilUIException: + tinfoil.shutdown() + raise DevtoolError('Failed to start bitbake environment') + except: + tinfoil.shutdown() + raise finally: os.chdir(orig_cwd) return tinfoil