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:54 +0100
commite616beba1c85e31246d1c798191b194d168b3489 (patch)
tree5b9d19e7c4a7caeb72f1bb9da4a2b221cfb1da96 /scripts/devtool
parentf2854c67ce963211f27223bd1194420621694bc2 (diff)
downloadpoky-e616beba1c85e31246d1c798191b194d168b3489.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 ..."). (From OE-Core rev: 5ec6d9ef309b841cdcbf1d14ac678d106d5d888a) 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():
289 289
290 if global_args.bbpath is None: 290 if global_args.bbpath is None:
291 tinfoil = setup_tinfoil(config_only=True, basepath=basepath) 291 tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
292 global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True) 292 try:
293 else: 293 global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
294 tinfoil = None 294 finally:
295 tinfoil.shutdown()
295 296
296 for path in [scripts_path] + global_args.bbpath.split(':'): 297 for path in [scripts_path] + global_args.bbpath.split(':'):
297 pluginpath = os.path.join(path, 'lib', 'devtool') 298 pluginpath = os.path.join(path, 'lib', 'devtool')
298 scriptutils.load_plugins(logger, plugins, pluginpath) 299 scriptutils.load_plugins(logger, plugins, pluginpath)
299 300
300 if tinfoil:
301 tinfoil.shutdown()
302
303 subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>') 301 subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')
304 subparsers.required = True 302 subparsers.required = True
305 303