summaryrefslogtreecommitdiffstats
path: root/scripts/devtool
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-08-05 15:48:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-03 23:45:46 +0100
commit5ec6d9ef309b841cdcbf1d14ac678d106d5d888a (patch)
tree0276975aedc0820dff4e28fcf7ddfea67fb6f5e3 /scripts/devtool
parent55115f90f909d27599c686852e73df321ad1edff (diff)
downloadopenembedded-core-5ec6d9ef309b841cdcbf1d14ac678d106d5d888a.tar.gz
scripts: ensure tinfoil is shut down correctly
We should always shut down tinfoil when we're finished with it, either by explicitly calling the shutdown() method or by using it as a context manager ("with ..."). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/devtool')
-rwxr-xr-xscripts/devtool10
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/devtool b/scripts/devtool
index b1274d69d8..91e3954dbb 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -289,17 +289,15 @@ def main():
if global_args.bbpath is None:
tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
- global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
- else:
- tinfoil = None
+ try:
+ global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
+ finally:
+ tinfoil.shutdown()
for path in [scripts_path] + global_args.bbpath.split(':'):
pluginpath = os.path.join(path, 'lib', 'devtool')
scriptutils.load_plugins(logger, plugins, pluginpath)
- if tinfoil:
- tinfoil.shutdown()
-
subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')
subparsers.required = True